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 –
PrsDataobject, 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 metadataname.what – Column key or list of column keys to plot.
fig – Optional figure. If given,
axmust be given as well.ax – Optional axes. If given,
figmust 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 ofData. If a dict, use the scales given for the keys.mode – Mode for labels and colors, for example
reflectionortransmission. IfNone, use the mode of the data, orreflection.transforms – List of
transformsto apply to the data.xlabel – If
True, use the tex label of the x-axis column, if str, use the given label, ifFalseset 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.