The crash happens with the TKAgg backend but not with the GTKAgg 
backend, but the script will still not animate. This one will however:

#---------------------------------------
import matplotlib
matplotlib.use("GTKAgg")
import matplotlib.pyplot as plt
import numpy as np
plt.ion()

x = np.arange(0,2*np.pi,0.01)            # x-array
data = np.array(np.sin(x))
line, = plt.plot(x,data)

for i in range(1,50):
     data[:] = np.sin(x+i/10.0)
     line.set_ydata(data+i-i)
     plt.draw()

plt.ioff()
#---------------------------------------

Note the +i-i on the set_ydata. For some reason set_ydata won't update 
on Windows if the array is the same, even if the data has changed.

João Luís Silva


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to