13

I've got a Manipulate that does a vector field plot. Basically a function that returns a list of Graphics objects and a couple of sliders:

Manipulate[
    Show[ReleaseHold[s[v, r1, r1 + s2] ]], 
    {{r1, 1.}, 1., 2.5 },
    {{s2, 1.}, 1., 2.5 },
    {{v, 1.}, 0., 2.5 }
  ]

Once I set the sliders in a position that I like, I discovered the neat feature "Paste Snapshot" that samples my slider position values, that I can use to save the resulting image to a file.

I've just discovered the autorun feature of Manipulate, which is a neat visualization tool. Is there a way save the autorun output showing the image and the sliders all animated in a list, so that I can run Export[ "filename.avi", %] as if I had a plain old table of images?

VividD
  • 3,660
  • 4
  • 26
  • 42
Peeter Joot
  • 6,398
  • 4
  • 36
  • 55

2 Answers2

24

UPDATE: I recently wrote a related post:

Showcasing Manipulate[…] via .GIF animations

OLDER: It is already automated. You can just Exportthe Manipulate output to get your movie:

m=Manipulate[Plot[Sin[a x + b], {x, -3, 3}], {a, 1, 10}, {b, -3, 3}]
Export["MyAutorun.avi", m]

This tutorial discuss it. Here is the summary:

  • By default Export will generate an animation by running the Manipulate through one Autorun cycle

  • When a Manipulate output containing explicit bookmarks is exported to a video animation format using Export, the resulting video will be one cycle through the sequence generated by Animate Bookmarks.

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
4

You may also play some tricks:

Mx = Table[Cos@t, {t, 0, 8 Pi, .1}];
My = Table[Sin@t, {t, 0, 8 Pi, .1}];
Mz = Table[t^.1, {t, 0, 8 Pi, .1}];
{x, y, z} = Interpolation[#, InterpolationOrder -> 1] & /@ {Mx, My, Mz};

m = Manipulate[Show@{

     Graphics3D[{Blue, Arrow[Tube[{{0, 0, 0}, {x[t], y[t], z[t]}}]]},
      Axes -> True, AxesLabel -> {"x", "y", "z"},
      PlotRange -> ({1.1 Min@#, 1.1 Max@#} & /@ {Mx, My, Mz})],

     ParametricPlot3D[{x[v], y[v], z[v]}, {v, 1, t}, 
      ColorFunction -> Function[{x, y, z, u}, Hue[z]]]},

   {t, 1.001, Length@Mx}, 
   Bookmarks -> {"a" :> (t = 1.001), "b" :> (t = Length@Mx), "c" :> (t = 1.001)}];

Export["c:\\test.mov", m]

enter image description here

Full Movie Link

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
  • 3
    Hi @Belisarius, how do you normally compress the data size of an exported animation? a 13-second video of mine is 85MB. – Vincent Tjeng Mar 13 '13 at 08:52