problem realtime plot

hi,

I tried to plot in realtime:

from pylab import *
import time

ion()

x=arange(0,2*pi,.01)
line,=plot(x,sin(x))
for i in arange(1,20):
    line.set_ydata(sin(x+i/10.0))
    draw()

but nothing happens when the script runs. I just see the last plot after the script has finished. Only a grey empty window during processing.

I tried to start it in ipython (stated with --pylab) as well as with python and pythonw on OS X Tiger.
I use Pyhton 2.4
matplotlib-0.87.7
wxPython 2.8.0

any hints for me?

thanks Jan

···

--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

Hi Jan,

I'm not sure about the reason, but your little example runs for me using
several backends (GtkAgg, TkAgg, WxAgg).
I'm using Debian (kernel 2.6) and matplotlib 0.90.0 at revison 3131.
Maybe it could help to add some more 'draw()' commands after plotting and
reseting data - not really good style, but sometimes helpful.

best regards,
Matthias

···

On Sunday 22 April 2007 18:50, Jan Winter wrote:

hi,

I tried to plot in realtime:
>from pylab import *

import time

ion()

x=arange(0,2*pi,.01)
line,=plot(x,sin(x))
for i in arange(1,20):
    line.set_ydata(sin(x+i/10.0))
    draw()

but nothing happens when the script runs. I just see the last plot after
the script has finished. Only a grey empty window during processing.

I tried to start it in ipython (stated with --pylab) as well as with python
and pythonw on OS X Tiger. I use Pyhton 2.4
matplotlib-0.87.7
wxPython 2.8.0

any hints for me?

thanks Jan