plot_spec#

mufasa.visualization.spec_viz.plot_spec(spc, xarr=None, ax=None, fill=False, xlab=None, ylab=None, **kwargs)[source]#

Plot a spectrum.

Parameters:
  • spc (Spectrum) – The spectrum to plot.

  • xarr (SpectroscopicAxis, optional) – The spectroscopic axis to use for the x-axis. If None, the spectrum’s spectral axis is used.

  • ax (matplotlib.axes.Axes, optional) – Axes object to plot on. If None, a new figure and axes are created.

  • fill (bool, optional) – Whether to fill the area under the curve. Default is False.

  • xlab (str, optional) – X-axis label.

  • ylab (str, optional) – Y-axis label.

  • **kwargs (dict) – Additional keyword arguments passed to ax.plot or ax.fill_between.

Returns:

  • fig (matplotlib.figure.Figure) – The figure object, if ax is None.

  • ax (matplotlib.axes.Axes) – The axes object.