plotnine.animation.PlotnineAnimation

PlotnineAnimation(
    plots, interval=200, repeat_delay=None, repeat=True, blit=False
)

Animation using ggplot objects

Parameters

plots : Iterable[ggplot]

ggplot objects that make up the the frames of the animation

interval : int = 200

Delay between frames in milliseconds. Defaults to 200.

repeat_delay : int = None

If the animation in repeated, adds a delay in milliseconds before repeating the animation. Defaults to None.

repeat : bool = True

Controls whether the animation should repeat when the sequence of frames is completed. Defaults to True.

blit : bool = False

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

Notes

  1. The plots should have the same facet and the facet should not have fixed x and y scales.
  2. The scales of all the plots should have the same limits. It is a good idea to create a scale (with limits) for each aesthetic and add them to all the plots.