Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Interactive Applications using Matplotlib

You're reading from   Interactive Applications using Matplotlib

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781783988846
Length 174 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

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...

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 $19.99/month. Cancel anytime
Banner background image