|
From: Tony S Yu <to...@MI...> - 2008-10-23 15:31:21
|
The GUI neutral animation example from the SciPy cookbook doesn't seem
to work for Wx or WxAgg backends. A plot window opens but nothing
happens. It appears to be some weird problem with ion on wx.
For example, the following code will run and immediately close:
>>> plt.ion()
>>> plt.plot(x, y)
>>> plt.show()
After removing plt.ion(), a plot window is opened and the program
doesn't end until the window is closed (as expected).
If I use TkAgg or Qt4Agg (the only other GUI backends I have
installed) the examples (above and below) work as expected.
-Tony
Full Example:
#~~~~
import matplotlib
matplotlib.use('WxAgg')
import matplotlib.pyplot as plt
import numpy as np
plt.ion()
x = np.arange(0, 2*np.pi, 0.01)
line, = plt.plot(x, np.sin(x))
for i in np.arange(1, 20):
line.set_ydata(np.sin(x + i/10.0))
plt.draw()
#~~~~
PS. This seems to work the same on both trunk and 0.98.3.
|