plotnine.animation.PlotnineAnimation

class plotnine.animation.PlotnineAnimation(plots: Iterable[Ggplot], interval: int = 200, repeat_delay: int | None = None, repeat: bool = True, blit: bool = False)[source]

Animation using ggplot objects

Parameters
plotspython:iterable

ggplot objects that make up the the frames of the animation

intervalnumber, optional

Delay between frames in milliseconds. Defaults to 200.

repeat_delaynumber, optional

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

repeatbool, optional

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

blitbool, optional

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.