prsctrl.data.plot.plot_spectrum#

plot_spectrum(data: PrsData | Path | str | ndarray[tuple[Any, ...], dtype[_ScalarT]], columns: list[str] | None = None, title: str | None = None, what: str | list[str] = ['dI-X_I'], fig: Figure | None = None, ax: Axes | ndarray[tuple[Any, ...], dtype[Axes]] | None = None, subplot_kw: dict = {}, use_scales: dict | bool = True, transforms: list[Callable[[ndarray[tuple[Any, ...], dtype[_ScalarT]], list[str]], tuple[ndarray[tuple[Any, ...], dtype[_ScalarT]], list[str]]]] | None = None, mode: str | None = None, xlabel: bool | str = True, add_second_xax: bool = True, **plot_spectrum_kw) → tuple[Figure, ndarray[tuple[Any, ...], dtype[Axes]]][source]#

Plot the given spectrum keys of the data, one subplot per key.

Parameters:
  • data – PrsData object, path to the data directory, or numpy array with the given columns.

  • columns – Column keys for data. Defaults to PrsData.default_spectrum_columns.

  • title – Title of the plot. If None, use the data’s metadata name.

  • what – Column key or list of column keys to plot.

  • fig – Optional figure. If given, ax must be given as well.

  • ax – Optional axes. If given, fig must be given as well.

  • subplot_kw – Keyword arguments to pass to plt.subplots() if no figure and axes are given.

  • use_scales – If True, use the column scales of Data. If a dict, use the scales given for the keys.

  • mode – Mode for labels and colors, for example reflection or transmission. If None, use the mode of the data, or reflection.

  • transforms – List of transforms to apply to the data.

  • xlabel – If True, use the tex label of the x-axis column, if str, use the given label, if False set no label.

  • add_second_xax – Whether to add a wavelength axis on top via add_wl_axis().

  • plot_spectrum_kw – Keyword arguments passed to plot_spectrum_on_ax().

Returns:

Figure, axes.