NDCubePlotMixin

class ndcube.mixins.NDCubePlotMixin[source] [edit on github]

Bases: object

Add plotting functionality to a NDCube class.

Methods Summary

plot([axes, plot_axis_indices, …])

Plots an interactive visualization of this cube with a slider controlling the wavelength axis for data having dimensions greater than 2.

Methods Documentation

plot(axes=None, plot_axis_indices=None, axes_coordinates=None, axes_units=None, data_unit=None, **kwargs)[source] [edit on github]

Plots an interactive visualization of this cube with a slider controlling the wavelength axis for data having dimensions greater than 2. Plots an x-y graph onto the current axes for 2D or 1D data. Keyword arguments are passed on to matplotlib. Parameters other than data and wcs are passed to ImageAnimatorWCS, which in turn passes them to imshow for data greater than 2D.

Parameters
  • plot_axis_indices (list) – The two axes that make the image. Default=[-1,-2]. This implies cube instance -1 dimension will be x-axis and -2 dimension will be y-axis.

  • axes (astropy.visualization.wcsaxes.core.WCSAxes or None:) – The axes to plot onto. If None the current axes will be used.

  • axes_unit (list of astropy.units.Unit) –

  • data_unit (astropy.unit.Unit) – The data is changed to the unit given or the cube.unit if not given, for 1D plots.

  • axes_coordinates (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. The physical coordinates expected by axes_coordinates should be an array of pixel_edges. A str entry in axes_coordinates signifies that an extra_coord will be used for the axis’s coordinates. The str must be a valid name of an extra_coord that corresponds to the same axis to which it is applied in the plot.