Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Interactive Applications using Matplotlib

You're reading from  Interactive Applications using Matplotlib

Product type Book
Published in Mar 2015
Publisher
ISBN-13 9781783988846
Pages 174 pages
Edition 1st Edition
Languages

The animation module


Now that we've had a crash course in animations for Matplotlib, let's take a step back and get to know the animation module. There is the base Animation class and three subclasses, namely, TimedAnimation, FuncAnimation, and ArtistAnimation. These classes handle all of the work necessary to initiate the animation upon call to show() and update the figure window with a new draw at the appropriate intervals. They also provide the interface to save your animation, hiding away many of the ugliness one might find when manually composing their own animation.

The most simple animation class is ArtistAnimation. You first perform all of the plotting, appending the artists of each frame into a list of lists. Each sublist represents all of the artists that should be visible for a given frame. The length of the list provided to the ArtistAnimation class is the number of frames the animation will have. When rendering, the ArtistAnimation class will modify the appropriate artists' visibility...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}