animate#
Class method.
- animate(graphics, fig, n_steps=None, export_path='./', export_name='animation', overwrite=False, format='gif', fps=5, writer=None)[source]#
Animation helper function.
Call this function with a configured
Graphics
instance and the respective figure. This function will export an animation with the results from thedo_mpc.data.Data
object.Either specify
format
andfps
or supply a configured writer (e.g.ImageMagickWriter
for gifs).- Parameters:
fig (
figure
) – Matplotlib Figure.n_steps (
int
) – number of time steps for the animation.export_path (
str
) – Path where to export the animation. Directory will be created if it doesn’t exist.export_name (
str
) – Name of the resulting animation (gif/mp4) file.overwrite (
bool
) – Check if export_name already exists in the supplied directory and overwrite or alter export_name.format (
str
) – Choose between gif or mp4.fps (
int
) – Frames per second for the resulting animation.writer (
Union
[FFMpegWriter
,ImageMagickWriter
]) – If supplied, thefps
andformat
argument are discarded. Use this to configure your own writer.
- Return type:
None
This page is auto-generated. Page source is not available on Github.