MapSequenceAnimator

class sunpy.visualization.animator.MapSequenceAnimator(mapsequence, annotate=True, **kwargs)[source] [edit on github]

Bases: sunpy.visualization.animator.BaseFuncAnimator

Create an interactive viewer for a MapSequence.

The following keyboard shortcuts are defined in the viewer:

  • ‘left’: previous step on active slider.

  • ‘right’: next step on active slider.

  • ‘top’: change the active slider up one.

  • ‘bottom’: change the active slider down one.

  • ‘p’: play/pause active slider.

Parameters
  • mapsequence (sunpy.map.MapSequence) – A MapSequence.

  • annotate (bool) – Annotate the figure with scale and titles.

  • fig (matplotlib.figure.Figure) – Figure to use.

  • interval (int) – Animation interval in milliseconds.

  • colorbar (bool) – Plot colorbar.

  • plot_function (function) – A function to call when each Map is plotted, the function must have the signature (fig, axes, smap) where fig and axes are the figure and axes objects of the plot and smap is the current frames Map object. Any objects returned from this function will have their remove() method called at the start of the next frame to clear them from the plot.

Notes

Extra keywords are passed to mapsequence[0].plot() i.e. the plot() routine of the maps in the sequence.

Methods Summary

plot_start_image(ax)

This method creates the initial image on the matplotlib.axes.Axes.

updatefig(val, im, slider)

Methods Documentation

plot_start_image(ax)[source] [edit on github]

This method creates the initial image on the matplotlib.axes.Axes.

Warning

This method needs to be implemented in subclasses.

Parameters

ax (matplotlib.axes.Axes) – This is the axes on which to plot the image.

Returns

matplotlib.image.AxesImage – An matplotlib.image.AxesImage object, the instance returned from matplotlib.pyplot.imshow.

updatefig(val, im, slider)[source] [edit on github]