Hello, I wrote the following scripts and expected that the y-axis of the figure changed after each calculation. But it did't work(the plot stayed at the very first state) Can somebody help me fix this?
Thanks! import numpy import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) def calulate1(steps_num): cell_num = 200 # Set the cell number. hy = numpy.zeros((1,cell_num),float) hy = hy[0] NSTEPS=1 cell=range(cell_num) line,=ax.plot(cell, hy) while NSTEPS<=steps_num: for k in cell[:cell_num-1]: hy[k]=hy[k]+5 line.set_ydata(hy) fig.canvas.draw() NSTEPS+=1 win = fig.canvas.manager.window fig.canvas.manager.window.after(200, calulate1(20)) plt.show() -- View this message in context: http://www.nabble.com/Got-problem-in-rendering-animation%28TkAgg%29-tp25710223p25710223.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users