spectrochempy.plot_baselineο
- plot_baseline(original, baseline, corrected, *, regions=None, show_regions=False, region_color=None, region_alpha=None, ax=None, clear=True, show=True, linewidth=1.0, linestyle='-', baseline_linestyle='-', baseline_color='tab:orange', **kwargs)[source]ο
Plot original, baseline, and corrected spectra in two stacked axes.
- Parameters:
original (NDDataset) β Original spectra (1D or 2D).
baseline (NDDataset) β Computed baseline (same shape as original).
corrected (NDDataset) β Baseline-corrected spectra (same shape as original).
regions (iterable of (x0, x1) pairs, optional) β Baseline fitting regions to highlight on the plot. Each region is a pair of x-coordinates in physical units.
show_regions (bool, optional) β If True and regions provided, display region spans on the top axis. Default is False.
region_color (str, optional) β Face color for region spans. If None, uses preferences.baseline_region_color.
region_alpha (float, optional) β Transparency for region spans (0-1). If None, uses preferences.baseline_region_alpha.
ax (None) β Must be None. This function creates its own two-axes figure.
clear (bool, optional) β If True, clear axes before plotting. Default is True.
show (bool, optional) β If True, display the figure. Default is True.
linewidth (float, optional) β Line width for all lines. Default is 1.0.
linestyle (str, optional) β Line style for original and corrected spectra. Default is β-β.
baseline_linestyle (str, optional) β Line style for baseline curves. Default is β-β.
baseline_color (str, optional) β Color for baseline curves. Default is βtab:orangeβ.
**kwargs β Additional keyword arguments (reserved for future use).
- Returns:
tuple β (ax_top, ax_bottom) matplotlib axes.
- Raises:
ValueError β If ax is provided (this function creates its own axes). If input shapes do not match. If input ndim is not 1 or 2.