MathGroup Archive 2002

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

Search the Archive

Re: Animation in one frame?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33049] Re: [mg33003] Animation in one frame?
  • From: Omega Consulting <omega_consulting at yahoo.com>
  • Date: Wed, 27 Feb 2002 00:48:09 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

At 12:31 AM 2/25/2002, William Hill wrote:
>Hey there ...
>Is there some option to have MoviePlot ( or whichever function is
>appropriate ) animate a plot of f(x,t) in one cell only? That is, to display
>the first plot, erase it, display the next, and so on, instead of having a
>long sequence of cells being generated.
>Thanx In Advance ...
>William

This will do the trick.

GraphicsCell[gr_] :=
   Cell[GraphicsData["PostScript", DisplayString[gr]],"Graphics"]

ReplaceGraphic[gr_] :=
   Module[{nb=EvaluationNotebook[]},
     SelectionMove[nb, All, GeneratedCell];
     NotebookWrite[nb, GraphicsCell[gr]]
   ]

AnimateInPlace[{first_, rest___}] :=
   (CellPrint[GraphicsCell[first]];
     Scan[ReplaceGraphic, {rest}])

Try it out.

grs=Table[
       Plot[a x/10, {x,0,1}, PlotRange->{0,1},
         DisplayFunction->Identity],{a,10}];

AnimateInPlace[grs]

--------------------------------------------------------------
Omega Consulting
"The final answer to your Mathematica needs"

Spend less time searching and more time finding.
http://www.wz.com/internet/Mathematica.html



  • Prev by Date: Solve (on Mathematica 4.1 Windows XP)?
  • Next by Date: Re: need a function for sums of subsets
  • Previous by thread: Re: Animation in one frame?
  • Next by thread: Partial derivatives and implicit inversion?