MapSequenceAnimator#
- class sunpy.visualization.animator.MapSequenceAnimator(mapsequence, annotate=True, **kwargs)[source]#
Bases:
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
) – AMapSequence
.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 eachMap
is plotted, the function must have the signature(fig, axes, smap)
wherefig
andaxes
are the figure and axes objects of the plot andsmap
is the current frame’sMap
object. Any objects returned from this function will have theirremove()
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. theplot()
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]#
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.artist.Artist
– The matplotlib object to be animated, this is usually either aAxesImage
object, or aLine2D
.