I want to figure out how to combine several graphics in manipulate such that only the ones that change are recomputed.
I looked into the tutorials on Advanced Manipulate, but couldn't figure out how to get this to work.
In the toy example below, I combine two graphics with Show
. When I move the control for the point p
, the ContourPlot
also gets recomputed, which leads to a low-res drawing (in my actual example, the graphs are a lot more complex, so re-evaluating them, even when the relevant parameters don't change isn't an option). I tried using Dynamic
, but couldn't find a solution that works. Any help highly appreciated!
Manipulate[
Show[ContourPlot[Cos[a x] + Cos[ a y], {x, 0, 1}, {y, 0, 1}],
Graphics[Disk[p, 0.02]]],
{{a, 10}, 0, 20},
{p, {0, 0}, {1, 1}}
]