hypertools.HyperAnimation

class hypertools.HyperAnimation(figure, animation)[source]

A (figure, animation) tuple with animation export/display helpers.

Indexing/unpacking behave exactly like the legacy 2-tuple (fig, anim = result; result[0] is the figure, result[1] the animation), so this is a drop-in replacement for the old return value.

Attributes:
animation

The underlying matplotlib.animation.Animation (usually a FuncAnimation).

figure

The matplotlib Figure the animation draws on.

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

save(filename, *args, **kwargs)

Save the animation to a file.

to_html5_video(*args, **kwargs)

Return an HTML5 <video> string for the animation (needs FFmpeg; delegates to matplotlib.animation.Animation.to_html5_video).

to_jshtml(*args, **kwargs)

Return an interactive JavaScript HTML animation (no FFmpeg needed; delegates to matplotlib.animation.Animation.to_jshtml).

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

save(filename, *args, **kwargs)

Save the animation to a file.

to_html5_video(*args, **kwargs)

Return an HTML5 <video> string for the animation (needs FFmpeg; delegates to matplotlib.animation.Animation.to_html5_video).

to_jshtml(*args, **kwargs)

Return an interactive JavaScript HTML animation (no FFmpeg needed; delegates to matplotlib.animation.Animation.to_jshtml).

Attributes

animation

The underlying matplotlib.animation.Animation (usually a FuncAnimation).

figure

The matplotlib Figure the animation draws on.