You are reading an old version of the documentation (v2.0.2). For the latest version see


This Page


class matplotlib.animation.Animation(fig, event_source=None, blit=False)

This class wraps the creation of an animation using matplotlib.

It is only a base class which should be subclassed to provide needed behavior.

This class is not typically used directly.


fig : matplotlib.figure.Figure

The figure object that is used to get draw, resize, and any other needed events.

event_source : object, optional

A class that can run a callback when desired events are generated, as well as be stopped and started.

Examples include timers (see TimedAnimation) and file system notifications.

blit : bool, optional

controls whether blitting is used to optimize drawing. Defaults to False.

__init__(fig, event_source=None, blit=False)


__init__(fig[, event_source, blit])
new_frame_seq() Creates a new sequence of frame information.
new_saved_frame_seq() Creates a new sequence of saved/cached frame information.
save(filename[, writer, fps, dpi, codec, ...]) Saves a movie file by drawing every frame.
to_html5_video() Returns animation as an HTML5 video tag.