In this recipe, we will explore how to animate our figures. Sometimes it is more descriptive to have pictures moving in animations to explain what happens if we change the values of variables. Our main library has limited but usually sufficient animation capabilities and we will explain how to use them.
The framework for animation is added to standard matplotlib from version 1.1 and its main class is
matplotlib.animation.Animation
. This class is the base class, which is to be subclassed for specific behavior, as is the case with the classes already provided: TimedAnimation
, ArtistAnimation
, and FuncAnimation
.