plot_classifications

mcalf.visualisation.classifications.plot_classifications(class_map, spectra, labels, extent=0, 200, 0, 200, xticks=0, 15, 3, yticks=0, 15, 3, xscale=0.070325, yscale=0.070325, output=None, figsize=None, dpi=600, fontfamily=None)[source]

Plot the spectra separated into their classifications along with an example classified map.

Must be 5 classifications.

Parameters
  • class_map (ndarray, ndim=2) – Two-dimensional array of classifications.

  • spectra (ndarray, ndim=2) – Two-dimensional array with dimensions [spectra, wavelengths].

  • labels (ndarray, ndim=1, length of spectra) – List of classifications for each spectrum in spectra.

  • output (str, optional, default = None) – If present, the filename to save the plot as.

  • figsize (2-tuple, optional, default = None) – Size of the figure.

  • dpi (int, optional, default = 600) – The number of dots per inch. For controlling the quality of the outputted figure.

  • fontfamily (str, optional, default = None) – If provided, this family string will be added to the ‘font’ rc params group.

  • vmin (float, optional, default = -max(|`velmap`|)) – Minimum velocity to plot. If not given, will be -vmax, for vmax not None.

  • vmax (float, optional, default = max(|`velmap`|)) – Maximum velocity to plot. If not given, will be -vmin, for vmin not None.

  • extent (4-tuple, optional, default = (0, 200, 0, 200)) – Region the velmap is cropped to.

  • xticks (3-tuple, optional, default = (0, 15, 2)) – The start, stop and step for the x-axis ticks in Mm.

  • yticks (3-tuple, optional, default = (0, 15, 2)) – The start, stop and step for the y-axis ticks in Mm.

  • xscale (float, optional = 0.725 * 0.097) – Scaling factor between x-axis data coordinate steps and 1 Mm. Mm = data / xscale.

  • yscale (float, optional = 0.725 * 0.097) – Scaling factor between y-axis data coordinate steps and 1 Mm. Mm = data / xscale.