matplotlib tutorial (13) nitta@tsuda.ac.jp

Chapter 13: Animation (compatible with Google Colab)

JSAnimation

Official document: https://matplotlib.org/api/animation_api.html

JSAnimation has been incorporated into matplotlib since matplotlib 2.1.

JSAnimation realizes animanation by continuously displaying images drawn by matplotlib.pyplot.

Use the magic '% matplotlib notebook'. Note that it is not '% matplotlib inline'.

ArtistAnimation() passes an array of generated images and displays them all together. FuncAnimation() displays every time an image is generated.

ArtistAnimation : Pass an array of images

One coordinate system (Axes)

Multiple coordinate systems (Axes)

FuncAnimation : Pass the function generating images

One coordinate system (Axes)

Multiple coordinate systems (Axes)