Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
    
Look up GraphicsRow[], GraphicsColumn[], or GraphicsGrid[]. –  J. M. May 6 '13 at 16:25

3 Answers 3

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]

enter image description here

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).

share|improve this answer

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}]

enter image description here

share|improve this answer

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}]
share|improve this answer
    
Yea, I usually use just Column/Row or even a simple List. –  amr May 6 '13 at 17:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.