Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Matplotlib 2.x

You're reading from  Mastering Matplotlib 2.x

Product type Book
Published in Nov 2018
Publisher Packt
ISBN-13 9781789617696
Pages 214 pages
Edition 1st Edition
Languages
Author (1):
Benjamin Walter Keller Benjamin Walter Keller
Profile icon Benjamin Walter Keller

Making movies

This section describes how to generate animations to make plots along with customizing the animation frame rate, speed, and repetitions.

How to generate animations to make plots that update themselves

Let's begin by importing the necessary functions and use the Matplotlib Notebook interactive backend. We will also import the FuncAnimation method from Matplotlib.animation.

Start by making the standard basic sine plot. We have also added a function that changes the Y data by moving it over to the first argument. We will now use the func.animation method. As we call the func.animation method with the figure and our update method as the two arguments, we get a nice animation of the sine wave:

# Basic FuncAnimation...
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}