# ImageAnimator¶

class sunpy.visualization.imageanimator.ImageAnimator(data, image_axes=[-2, -1], axis_ranges=None, **kwargs)[source] [edit on github]

Bases: sunpy.visualization.imageanimator.ArrayAnimator

Create a matplotlib backend independent data explorer for 2D images.

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

This viewer can have user defined buttons added by specifying the labels and functions called when those buttons are clicked as keyword arguments.

Parameters: data (ndarray) – The data to be visualized >= 2D image_axes (list) – The two axes that make the image fig (mpl.figure) – Figure to use axis_ranges (list of physical coordinates for array or None) – If None array indices will be used for all axes. If a list it should contain one element for each axis of the numpy array. For the image axes a [min, max] pair should be specified which will be passed to matplotlib.pyplot.imshow() as extent. For the slider axes a [min, max] pair can be specified or an array the same length as the axis which will provide all values for that slider. If None is specified for an axis then the array indices will be used for that axis. interval (int) – Animation interval in ms colorbar (bool) – Plot colorbar button_labels (list) – List of strings to label buttons button_func (list) – List of functions to map to the buttons keywords are passed to imshow. (Extra) –

Methods Summary

 plot_start_image(ax) Sets up plot of initial image. update_plot(val, im, slider) Updates plot based on slider/array dimension being iterated.

Methods Documentation

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

Sets up plot of initial image.

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

Updates plot based on slider/array dimension being iterated.