Introduction to the plotting librairie

import spectrochempy as scp

The location of the spectrochempy_data can be found in preferences

Let’s read on of the dataset (in spg Omnnic format)

dataset = scp.NDDataset.read_omnic(datadir / "irdata" / "nh4y-activation.spg")

First we do a generic plot (with the default style):

ax = dataset[0].plot()
plot plotting

plot generic style

ax = dataset[0].plot(style="classic")
plot plotting

check that style reinit to default should be identical to the first one

ax = dataset[0].plot()
plot plotting

Multiple plots

dataset = dataset[:, ::100]

datasets = [dataset[0], dataset[10], dataset[20], dataset[50], dataset[53]]
labels = ["sample {}".format(label) for label in ["S1", "S10", "S20", "S50", "S53"]]

_ = scp.plot_multiple(method="scatter", datasets=datasets, labels=labels, legend="best")
plot plotting

plot multiple with style

_ = scp.plot_multiple(
    method="scatter", style="sans", datasets=datasets, labels=labels, legend="best"
)
plot plotting

check that style reinit to default

_ = scp.plot_multiple(method="scatter", datasets=datasets, labels=labels, legend="best")
plot plotting

This ends the example ! The following line can be uncommented if no plot shows when running the .py script

scp.show()

Total running time of the script: ( 0 minutes 1.677 seconds)

Gallery generated by Sphinx-Gallery