# Can I layer a dynamic plot over a static plot?

Is there a way to layer a static plot over a manipulated plot? So I could, for instance, show a red point moving along a sin curve, superimposed over a static plot of the sin. I tried this but the manipulated plot won't turn up in Show, which complains it's not a plot.

• Yes, ofcourse you can. But why not just generate the sin plot each time? Why does it have to be pre-drawn outside the Manipulate? Also it will be better to show what you tried, even if it does not work. That will give something to start with and get better idea what you are trying to do. Sep 12, 2022 at 0:44

## 1 Answer

Here is an example:

sin = Plot[Sin[x], {x, -3 Pi, 3 Pi}];
Manipulate[
Show[
sin,
Graphics[{Red, PointSize[0.04], Point[{x, Sin[x]}]}]
],
{x, -3 Pi, 3 Pi}
]


• Thanks. That's a more compact way of doing it than I found. While I was waiting, I figured out how to do it with Epilog - but it's more obtuse: Manipulate[ Plot[{Sin[c x], Cos[x]}, {x, 0, 2 Pi}, PlotRange -> {-1, 1}, Epilog -> {PointSize[Large], Point[{n, Cos[n]}]}], {c, .565, 3}, {n, 0, 2 Pi}] Sep 13, 2022 at 20:33
• @cybervigilante Your approach makes sense as well, as long as the static plot is not time consuming. Sep 14, 2022 at 1:02