save_animation

odl.solvers.util.callback.save_animation(filename, writer=None, writer_kwargs=None, dpi=None, saving_kwargs=None, fig=None, step=1)[source]

Context manager for creating animations from a series of plots.

The context manager uses matplotlib.animation to generate the animation.

Parameters
filenamestr

Name of the generated output file.

writerstr

Back-end for generating the movie file. Available writers can be checked with the command matplotlib.animation.writers.list(). See the `matplotlib animation writers doc`_ for details. For the default None, the first writer from the list of available ones is chosen.

writer_kwargsdict

Keyword arguments passed to the writer class constructor. See the `matplotlib animation writers doc`_ for details.

dpifloat, optional

Resolution of the saved frames in DPI. For None, the figure resolution fig.dpi is used, which is the default resolution if fig is None.

saving_kwargsdict

Keyword arguments passed to the saving method of the writer instance. See the `matplotlib animation writers doc`_ for details.

figmatplotlib.figure.Figure, optional

Matplotlib figure used for plotting. For the default None, a new figure is created.

steppositive int, optional

Number of iterations between frames.

.. _matplotlib animation writers doc:

https://matplotlib.org/api/animation_api.html#writer-classes