Lubos Vrbka wrote: > hello, > >> why is it actually not possible to do something like the following piece >> of code? >> ioff() >> plot commands >> draw() >> ion() > actually, i did some test now (modification of the example > http://www.scipy.org/Cookbook/Matplotlib/Animations site): > > from pylab import * > ioff() > x = arange(0,2*pi,0.01) # x-array > line, = plot(x,sin(x)) > draw() > > displays nothing, then > > ion() > for i in arange(1,200): > line.set_ydata(sin(x+i/10.0)) # update the data > draw() # redraw the canvas > > displays nothing as well, but shows the same 'lag' as when running the > whole code in interactive mode. that means that the data is processed, > the graphics is plotted, just the window is not displayed. > > i thought that ioff() is present exactly for this purpose. > unfortunately, the documentation page > > http://matplotlib.sourceforge.net/interactive.html > > shows only an example where an image file is produced first with ioff(), > the figure is closed and something is then displayed with ion(). > > when i later issue another plot() command (i.e., plot(random(20), > random(20)), it is displayed and shows also the last part of the sin(x) > plot... > > the thing i want to achieve is maybe impossible - i'd just love to know > why, or what am i doing wrong... i'm very grateful for any hints.
Try looking at the dynamic_image_*.py in the examples directory (or examples/animation for version 0.98.x). I've personally used the dynamic_image_gtkagg.py approach for (what I think is) a similar use case to yours. Before finding that one, I went through a variety of approaches with threading, ion()/ioff() and draw(). Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users