Revision: 8662 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8662&view=rev Author: ryanmay Date: 2010-08-26 03:40:09 +0000 (Thu, 26 Aug 2010)
Log Message: ----------- Add another set of basic examples. Added Paths: ----------- trunk/matplotlib/examples/animation/basic_example.py Added: trunk/matplotlib/examples/animation/basic_example.py =================================================================== --- trunk/matplotlib/examples/animation/basic_example.py (rev 0) +++ trunk/matplotlib/examples/animation/basic_example.py 2010-08-26 03:40:09 UTC (rev 8662) @@ -0,0 +1,34 @@ +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.animation as animation + +def update_line(num, data, line): + line.set_data(data[...,:num]) + return line, + +fig1 = plt.figure() + +data = np.random.rand(2, 25) +l, = plt.plot([], [], 'r-') +plt.xlim(0, 1) +plt.ylim(0, 1) +plt.xlabel('x') +plt.title('test') +line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l), + interval=50, blit=True) +#line_ani.save('lines.mp4') + +fig2 = plt.figure() + +x = np.arange(-9, 10) +y = np.arange(-9, 10).reshape(-1, 1) +base = np.hypot(x, y) +ims = [] +for add in np.arange(15): + ims.append((plt.pcolor(x, y, base + add, norm=plt.Normalize(0, 30)),)) + +im_ani = animation.ArtistAnimation(fig2, ims, interval=50, repeat_delay=3000, + blit=True) +#im_ani.save('im.mp4') + +plt.show() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins