why doesn't this animation work?

Hello,

I was wondering why the following animation doesn’t work. I thought it did work before, but perhaps I am misremembering. I am on OS X 10.4, matplotlib version 0.99.0 from the enthought distribution. I must be thinking about this wrong someone, but I thought that if you did a plot, then updated the data on the plot object, and called draw that it would actually draw it (like it does in matlab). right now it just gives me a blank figure, with a busy mouse icon, and then shows the last plot done.

thanks,

		Brian Blais

import numpy

import matplotlib.pyplot as plt

h,=plt.plot([1,2,3])

plt.ylabel(‘some numbers’)

plt.show()

for i in range(100):

h.set_ydata(numpy.random.rand(3)*2+1)

plt.draw()

···

Brian Blais

bblais@…1129…

http://web.bryant.edu/~bblais

What backend are you using?

There was a similar report that the "draw" method of the qt4agg
backend does not update the screen immediately but wait until it gets
idle.
See if using other backends makes any change.

-JJ

···

On Sat, Nov 14, 2009 at 3:21 PM, Brian Blais <bblais@...1129...> wrote:

Hello,
I was wondering why the following animation doesn't work. I thought it did
work before, but perhaps I am misremembering. I am on OS X 10.4, matplotlib
version 0.99.0 from the enthought distribution. I must be thinking about
this wrong someone, but I thought that if you did a plot, then updated the
data on the plot object, and called draw that it would actually draw it
(like it does in matlab). right now it just gives me a blank figure, with a
busy mouse icon, and then shows the last plot done.
thanks,
Brian Blais

import numpy
import matplotlib.pyplot as plt
h,=plt.plot([1,2,3])
plt.ylabel('some numbers')
plt.show()
for i in range(100):
h.set_ydata(numpy.random.rand(3)*2+1)
plt.draw()

--
Brian Blais
bblais@...1129...
bblais on the web

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

What backend are you using?

ah! it seems to work with the tkagg backend, but not the wxagg backend.

I am using ipython with the -pylab flag.

I remember having some problem with the tk backend (perhaps when I was doing some wx embedding), but I can’t recall what it was. is there a reason the wx backend doesn’t work as I expect?

on a related note, is there a way in ipython to specify the backend for the -pylab flag, overriding the one specified in matplotlibrc?

	thanks,

		bb

There was a similar report that the “draw” method of the qt4agg

backend does not update the screen immediately but wait until it gets

idle.

See if using other backends makes any change.

import numpy

import matplotlib.pyplot as plt

h,=plt.plot([1,2,3])

plt.ylabel(‘some numbers’)

plt.show()

for i in range(100):

h.set_ydata(numpy.random.rand(3)*2+1)

plt.draw()
···

On Nov 14, 2009, at 17:40 , Jae-Joon Lee wrote:

Brian Blais

bblais@…2705…29…

http://web.bryant.edu/~bblais