From: Brian B. <bb...@br...> - 2010-09-20 23:13:14
|
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 bb...@br... http://web.bryant.edu/~bblais http://bblais.blogspot.com/ |