[SciPy-user] Simple 2D animations?

Nils Wagner nwagner at mecha.uni-stuttgart.de
Thu Mar 17 11:06:23 EST 2005


Petr Kucera wrote:

>Hello Scipy users!
>
>I'm new here and actually I'm looking for a tool to plot simple 2D animations.  
>I want for example do a simple 2D animation showing earth going around the 
>sun. Another example is to plot x-y animation of lorenz attractor. I would 
>like to have a point which will move with time and possible draw the trail.
>
>To give a better idea, here is a simple script:
>============================
>import Numeric
>t = 0
>i = 0
>while 1:
>    t=i/100.0
>    x=Numeric.sin(t)
>    y=Numeric.sin(t+0.5)
>    print x, y
>    i+=1
>============================
>
>I would like to plot just last (x,y) point. I should get a simple animation, 
>where the (x,y) will move in a graph.
>
>Is SciPy the right tool for me?
>
>Many thanks for any hint!
>Peter
>____________________________________________________________
>http://www.seznam.cz - e-mailová schránka 1000 MB
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>  
>
You may try

import Numeric
from scipy import *
from scipy.xplt import *
import gui_thread
xplt.hold('on')
t = 0
i = 0

while 1:
    t=i/100.0
    x=Numeric.sin(t)
    y=Numeric.sin(t+0.5)
    print x, y
    xplt.plot(x,y,'b+')
    xplt.pause(10)
    i+=1


Nils




More information about the SciPy-User mailing list