MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: RE: animation

  • To: mathgroup at
  • Subject: [mg46548] RE: [mg45111] RE: [mg45073] animation
  • From: "Ingolf Dahl" <ingolf.dahl at>
  • Date: Mon, 23 Feb 2004 02:15:39 -0500 (EST)
  • Sender: owner-wri-mathgroup at

In my series "Old questions, new answers" I want to show another way to do
animation to a closed group, avoiding showing all rendered cells. Try this:

plotlist =
        Plot[Sin[x], {x, 0., i*2\[Pi]/36.}, PlotRange -> {{0, 7}, {-1, 1}},
          DisplayFunction -> Identity],
        ListPlot[{{i*2\[Pi]/36., Sin[i*2\[Pi]/36.]}},
          PlotStyle -> {PointSize[0.03], RGBColor[1, 0, 0]},
          PlotRange -> {{0, 7}, {-1.1, 1.1}},
          DisplayFunction -> Identity]], {i, 1, 36}];

plotlist = Prepend[plotlist, plotlist[[36]]];

    animationdisplaytime_] := (NotebookWrite[EvaluationNotebook[],
            GraphicsData["PostScript", DisplayString[graphicslist[[i]]]],
            "Graphics"], {i, Length[graphicslist]}], Closed ], After];
    SelectionMove[EvaluationNotebook[], Previous, CellGroup];
    SelectionAnimate[EvaluationNotebook[] ,
      AnimationDisplayTime -> animationdisplaytime])

AnimateToClosedGroup[plotlist, 0.15]

Plotlist can of course be replaced by any list of graphics.
Best regards

Ingolf Dahl

>-----Original Message-----
>From: David Park [mailto:djmp at]
To: mathgroup at
>Sent: Wednesday, December 17, 2003 13:54
>To: mathgroup at
>Subject: [mg46548] [mg45111] RE: [mg45073] animation
>You could avoid the For loop my using...
>Animate[ListPlot[...i ...], {i, 1, n, 1}]
>SelectionMove[EvaluationNotebook[], All, GeneratedCell]
>FrontEndTokenExecute["OpenCloseGroup"]; Pause[0.5];
>AnimationDisplayTime -> 0.1,
>      AnimationDirection -> Forward]}]
>You can't directly avoid rendering all the frames. (Actually you
>could use a
>scheme like Ingolf Dahl posted yesterday but that only runs the animation
>once and provides no controls.)
>The additional statements above will select the frames, close them up and
>start the animation. The 200 is the number of seconds to run the animation.
>(If you are using DrawGraphics you can click the statements in from the
>A good way to view animations is by using the arrow keys. arrow up
>and arrow
>down advance one frame at a time. arrow left and arrow right start the
>animation in each direction. The keys on the number pad will control the
>speed. "p" will pause the animation. "c" will run the animation in
>forward-backward mode.
>David Park
>djmp at
>From: M.L. Bondar [mailto:mbondar at]
To: mathgroup at
>To: mathgroup at
>I have the following problem with Mathematica.
> I need to make an animation and I use For[i=1, i<=n ListPlot[.....]; i++]
> which creates n plots. After that I double click on the grouping bracket
>to the right of the plots to close the group and animate it.
>Is there any possibility to make the animation avoiding  the ploting of
>all n plots?
>Thank you in advance.
>Luiza Bondar

  • Prev by Date: Re: i dont understand module.
  • Next by Date: integral
  • Previous by thread: Re: Attributes and behaviors?
  • Next by thread: Re: animation