Note
Go to the end to download the full example code.
Introduction to the plotting library
This short gallery example shows three common ideas:
the default
dataset.plot()entry point;per-call style changes that do not mutate later plots;
plot_multiple()overlaying several 1D datasets on one shared axes.
import os
from pathlib import Path
import numpy as np
import spectrochempy as scp
Locate and load a dataset
Default plot and style

Per-call style changes
Apply a style to this single plot only:

The style change is local — the default style is used again here:

Overlay with plot_multiple
dataset = dataset[:, ::100]
sample_indices = np.linspace(0, dataset.shape[0] - 1, 5, dtype=int)
datasets = [dataset[index] for index in sample_indices]
labels = [f"sample {index}" for index in sample_indices]
_ = scp.plot_multiple(method="scatter", datasets=datasets, labels=labels, legend="best")

The style change applies only to this call:

The default style is used again on the next call:

This ends the example ! The following line can be uncommented if no plot shows when running the .py script with python
# scp.show()
Total running time of the script: (0 minutes 1.751 seconds)