Re: How to animate the process of a function Plot in only one picture.
- To: mathgroup at smc.vnet.net
- Subject: [mg22652] Re: [mg22613] How to animate the process of a function Plot in only one picture.
- From: "David Park" <djmp at earthlink.net>
- Date: Thu, 16 Mar 2000 09:11:09 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
>Dear all, >How can I plot, for example, sin(x) and see the curve gradually extending >from x=0 ( curve up and down) until x=2pi? >Thanks. >My e-mail address : mailto:mhl at gn.tpemail.net.tw > Mason Lee > Mason, I think this is what you are looking for. Needs["Graphics`Animation`"] This defines a single frame of the animation. frame[t_] := Plot[Sin[x], {x, -0.0001, t }, PlotRange -> {{-0.01, 2 Pi + 0.01}, {-1.1, 1.1}}] This does the animation. Animate[frame[t], {t, 0, 2Pi}] There are two little tricks. Mathematica does not like to plot with the iterator {x, 0, 0}, so the starting value was made slightly negative. We have to set the the PlotRange so that all frames will be the same. And maybe someone else can answer this question for me. How does one produce an animation that will do only one cycle when it is initiated? I have never been able to implement that and the Option Inspector control does not seem to work. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/