Animation Example Code - Animate - Decay - Py - Matplotlib 1.4
Animation Example Code - Animate - Decay - Py - Matplotlib 1.4
animation Examples
Previous topic
animation Examples
Next topic
Show Source
Quick search
Go
Enter search terms or a module, class
or function name.
Ads by Lyrics
Ad Options
1/3
11/19/2014
ax.grid()
xdata, ydata = [], []
def run(data):
# update the data
t,y = data
xdata.append(t)
ydata.append(y)
xmin, xmax = ax.get_xlim()
if t >= xmax:
ax.set_xlim(xmin, 2*xmax)
ax.figure.canvas.draw()
line.set_data(xdata, ydata)
return line,
ani = animation.FuncAnimation(fig, run, data_gen, blit=True, interval=10,
repeat=False)
plt.show()
Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the matplotlib development team; 2012 - 2014 The matplotlib
development team. Last updated on Oct 25, 2014. Created using Sphinx 1.3b2.
Ads by Lyrics
http://matplotlib.org/examples/animation/animate_decay.html
Ad Options
2/3
11/19/2014
WebSpades Advertisement
http://matplotlib.org/examples/animation/animate_decay.html
3/3