# Sync Animated Plots

Here is my Lorenz code:

sol = NDSolve[{x'[t] == -10 (x[t] - y[t]),
y'[t] == -x[t] z[t] + 24.74 x[t] - y[t],
z'[t] == x[t] y[t] - 8/3 z[t], x[0] == 3, y[0] == 5,
z[0] == 8}, {x[t], y[t], z[t]}, {t, 0, 100}, MaxSteps -> Infinity]


Here is x[t] vs z[t] and x[t] vs t:

p = ParametricPlot[{x[t], z[t]} /. sol, {t, 0, 30}];
pdata = p[[1, 1, 3, 2, 1]];
Manipulate[
ListLinePlot[pdata[[1 ;; m]], PlotRange -> {{-20, 20}, {0, 45}}], {m,
1, Length[pdata], 1}]

p2 = Plot[x[t] /. sol, {t, 0, 30}];
p2data = p2[[1, 1, 3, 2, 1]];
Manipulate[
ListLinePlot[p2data[[1 ;; m]],
PlotRange -> {{0, 30}, {-18, 18}}], {m, 1, Length[pdata], 1}]


Is it possible run p and p2 simultaneously in sync?

-
Look up GraphicsRow[], GraphicsColumn[], or GraphicsGrid[]. – J. M. May 6 '13 at 16:25

You can use the LocalizeVariables option:

Manipulate[
ListLinePlot[pdata[[1 ;; m]], PlotRange -> {{-20, 20}, {0, 45}}],
{m, 1, Length[pdata], 1}, LocalizeVariables -> False],

Manipulate[
ListLinePlot[p2data[[1 ;; m]], PlotRange -> {{0, 30}, {-18, 18}}],
{m, 1, Length[pdata], 1}, LocalizeVariables -> False]


But you should be clear that you can put really anything inside Manipulate. You could put a 1000x1000 grid of live cat videos in one Manipulate, if your computer was capable (mine cannot handle so much cat).

-

There is no need for your data extraction, so I'm not using your pdata = p[[1, 1, 3, 2, 1]], etc.:

Manipulate[ GraphicsRow@{
Plot[x[t] /. sol,                   {t, 0, m}, PlotRange -> {{0, 30}, {-18, 18}}],
ParametricPlot[{x[t], z[t]} /. sol, {t, 0, m}, PlotRange -> {{-20, 20}, {0, 45}},
PerformanceGoal -> "Quality"]},
{m, 10^-6, 30}]


-

I usually prefer Grid over GraphicsGrid and the like:

Manipulate[Grid@{{
ListLinePlot[pdata[[1 ;; m]],
PlotRange -> {{-20, 20}, {0, 45}},
ImageSize -> 300]},
{ListLinePlot[p2data[[1 ;; m]],
PlotRange -> {{0, 30}, {-18, 18}},
ImageSize -> 300]}},
{m, 1, Length[pdata], 1}]

-
Yea, I usually use just Column/Row or even a simple List. – amr May 6 '13 at 17:01