iris.experimental.animate¶
Wrapper for animating iris cubes using iris or matplotlib plotting functions
In this module:
- iris.experimental.animate.animate(cube_iterator, plot_func, fig=None, **kwargs)[source]¶
Animates the given cube iterator.
Args:
- cube_iterator (iterable of
iris.cube.Cubeobjects): Each animation frame corresponds to each
iris.cube.Cubeobject. Seeiris.cube.Cube.slices().
- cube_iterator (iterable of
- plot_func (
iris.plotoriris.quickplotplotting function): Plotting function used to animate. Must accept the signature
plot_func(cube, vmin=vmin, vmax=vmax, coords=coords).contourf(),contour(),pcolor()andpcolormesh()all conform to this signature.
- plot_func (
Kwargs:
- fig (
matplotlib.figure.Figureinstance): By default, the current figure will be used or a new figure instance created if no figure is available. See
matplotlib.pyplot.gcf().
- fig (
- coords (list of
Coordobjects or coordinate names): Use the given coordinates as the axes for the plot. The order of the given coordinates indicates which axis to use for each, where the first element is the horizontal axis of the plot and the second element is the vertical axis of the plot.
- coords (list of
- interval (int, float or long):
Defines the time interval in milliseconds between successive frames. A default interval of 100ms is set.
- vmin, vmax (int, float or long):
Color scaling values, see
matplotlib.colors.Normalizefor further details. Default values are determined by the min-max across the data set over the entire sequence.
See
matplotlib.animation.FuncAnimationfor details of other valid keyword arguments.- Returns
FuncAnimationobject suitable for saving and or plotting.
For example, to animate along a set of cube slices:
cube_iter = cubes.slices(('grid_longitude', 'grid_latitude')) ani = animate(cube_iter, qplt.contourf) plt.show()