[SciPy-user] Re: [SciPy-dev] xplt, drawing-time...

Travis E. Oliphant oliphant.travis at ieee.org
Wed Mar 12 14:56:58 EST 2003


Johannes Broedel wrote:

> Hi, I just tried xplt, it works fine on both, teh Linux and the 
> Windows-Machine.
> I want to show dynamic processes, e.g. computing 1000 data points to 
> be shown not all at the same time - they should appear one after the 
> other. At the moment xplt seems to collect the points and to draw them 
> finally. Does anyone know a solution for that? 


Perhaps what you want is simply the xplt.hold('on') function that will 
hold the previous plot.  Then you can plot data points one at a time in 
a loop.  You may have to issue calls to xplt.pause(<milliseconds>)  to 
delay the next plot.

I just checked in to CVS a fix for the current problem that xplt.plot 
cannot handle plotting a single data point.   (a quick fix is to get rid 
of the squeeze function everywhere it shows up in xplt/Mplot.py).  

Also, check out xplt.animate() if you think the result is blinking too 
much.

I just tried the following code and it gave me a nice animation:

xplt.figure()
x = r_[0:10:1000j]
xplt.hold('on')
for xval in x:
      yval = sin(xval / 4)
      xplt.plot(xval, yval, 'x')
      xplt.pause(100)

If you don't like the changing limits on the plot as it runs, then just 
issue
xplt.limits(xlow,xhigh,ylow,yhigh) before the for loop.

-Travis O.




>
> Thanks in advance, Johannes Broedel
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev






More information about the SciPy-User mailing list