plot_spectrum

mcalf.visualisation.plot_spectrum(wavelengths, spectrum, output=None, normalised=True, smooth=True, figsize=7, 3, dpi=600, fontfamily=None)[source]

Plot a spectrum with the wavelength grid shown.

Intended for plotting the raw data.

Parameters
  • wavelengths (ndarray) – The x-axis values.

  • spectrum (ndarray, length=n_wavelengths) – The y-axis values.

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

  • normalised (bool, optional, default = True) – Whether to normalise the spectrum using the last three spectral points.

  • smooth (bool, optional, default = True) – Whether to smooth the spectrum with a spline.

  • 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.