Faster rendering by using blitting
Blitting is a standard technique in raster graphics that,
in the context of Matplotlib, can be used to (drastically) improve
performance of interactive figures. For example, the
animation and widgets modules use blitting
internally. Here, we demonstrate how to implement your own blitting, outside
of these classes.
Blitting speeds up repetitive drawing by rendering all non-changing graphic elements into a background image once. Then, for every draw, only the changing elements need to be drawn onto this background. For example, if the limits of an Axes have not changed, we can render the empty Axes including all ticks and labels once, and only draw the changing data later.
The strategy is
Prepare the constant background:
Draw the figure, but exclude all artists that you want to animate by marking them as (see ).

