Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

RE: RE: animation

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

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 =
    Table[Show[
        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]]];

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

AnimateToClosedGroup[plotlist, 0.15]

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

Ingolf Dahl
Sweden

>-----Original Message-----
>From: David Park [mailto:djmp at earthlink.net]
To: mathgroup at smc.vnet.net
>Sent: Wednesday, December 17, 2003 13:54
>To: mathgroup at smc.vnet.net
>Subject: [mg46548] [mg45111] RE: [mg45073] animation
>
>
>Luiza,
>
>You could avoid the For loop my using...
>
>Needs["Graphics`Animation`"]
>
>Animate[ListPlot[...i ...], {i, 1, n, 1}]
>SelectionMove[EvaluationNotebook[], All, GeneratedCell]
>FrontEndTokenExecute["OpenCloseGroup"]; Pause[0.5];
>FrontEndExecute[{FrontEnd`SelectionAnimate[200,
>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
>DrawGraphicsPalette.)
>
>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 earthlink.net
>http://home.earthlink.net/~djmp/
>
>From: M.L. Bondar [mailto:mbondar at win.tue.nl]
To: mathgroup at smc.vnet.net
>To: mathgroup at smc.vnet.net
>
>
>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.
>
>Regards,
>
>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