spectrochempy.plot_multiple#

plot_multiple(datasets, method='scatter', pen=True, labels=None, marker='AUTO', color='AUTO', ls='AUTO', lw=1, shift=0, *, alpha=None, figsize=None, ax=None, clear=True, show=True, **kwargs)[source]#

Overlay several 1D datasets on a single Matplotlib axes.

Parameters:
  • datasets (list of 1D NDDataset) – Datasets to plot. If a single dataset is passed, plot_multiple() falls back to the regular dataset.plot() path and preserves the requested method.

  • method (str among [scatter, pen]) – Geometry to use for each overlaid dataset. "scatter" produces marker-based rendering; "pen" produces line rendering.

  • pen (bool, optional, default: True) – If method="scatter", also draw connecting lines between markers.

  • labels (a list of str, optional) – Labels used for the legend. The length of the list must match the number of datasets to plot.

  • marker (str, list` os str or AUTO, optional, default: ‘AUTO’) – Marker type for scatter plot. If marker is not provided then the scatter type of plot is chosen automatically.

  • color (str, list` os str or AUTO, optional, default: ‘AUTO’) – Color of the lines. If color is not provided then the color of the lines is chosen automatically.

  • ls (str, list os str or AUTO, optional, default: ‘AUTO’) – Line style definition. If ls is not provided then the line style is chosen automatically.

  • lw (float, list`of  `floats, optional, default: 1.0) – Line width. If lw is not provided then the line width is chosen automatically.

  • shift (float, list`of  `floats, optional, default: 0.0) – Vertical shift of the lines.

  • alpha (float or sequence of float or None, optional) – Opacity from 0 (transparent) to 1 (opaque). A scalar applies to all traces. A sequence supplies one value per dataset. Use None for the default opacity of a trace.

  • figsize (tuple of float, optional) – Width and height in inches when creating a figure. An explicit ax retains its figure size.

  • ax (Axes, optional) – Axes to plot on. If None, a new figure is created.

  • clear (bool, optional) – Whether to start from a clean figure. Default: True. An explicit ax owns its figure and ignores this flag; without ax, clear=False reuses the current figure, as in dataset.plot().

  • show (bool, optional) – Whether to display the figure. Default: True.

  • output (str or pathlib.Path, optional) – File name where the completed overlay is saved, legend included. Saving happens after every dataset has been drawn.

  • **kwargs – Other parameters passed to the underlying 1D plotting calls. Common aliases such as lw, ls, ms, mew, and c are normalized internally before rendering.

Returns:

matplotlib.axes.Axes – The shared axes containing the overlaid datasets.

Examples using spectrochempy.plot_multiple#

Decompose a 3D dataset with CP/PARAFAC

Decompose a 3D dataset with CP/PARAFAC

Cross-validation of corn moisture models

Cross-validation of corn moisture models

Integrate a baseline-corrected IR band

Integrate a baseline-corrected IR band

Using plot_multiple to plot several datasets on the same figure

Using plot_multiple to plot several datasets on the same figure

Introduction to the plotting library

Introduction to the plotting library

Savitzky-Golay and Whittaker-Eilers smoothing of a Raman spectrum

Savitzky-Golay and Whittaker-Eilers smoothing of a Raman spectrum