Hello,
I am trying to do some simple calculations in a loop, and draw a plot
periodically within the loop, and the drawing is not updating. I'm using the
Enthought Python Distribution which is using Matplotlib 0.99.3 with python
2.6.5 on Snow Leopard, OSX 10.6.4, and am running it in ipython with the -pylab
flag (and I've tried with the -wthread flag too). A sample piece of code
below. It is actually drawing, because when I control-C to stop, it shows the
plot.
from pylab import *
from numpy import *
import sys
def dot():
sys.stdout.write('.')
sys.stdout.flush()
def busy_loop():
for i in range(1000):
r=rand(100,100)
return r
for t in range(1000):
r=busy_loop()
clf()
imshow(r,interpolation='nearest',cmap=cm.gray)
draw()
show()
dot()
and I've set in my matplotlibrc - backend : TkAgg, but it doesn't work
with WxAgg either.
Am I missing something? Is this an idiom that needs to be avoided/replaced?
Any help would be great!
thanks,
Brian Blais
--
Brian Blais
[email protected]
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users