Note
Go to the end to download the full example code.
Choose an explicit plot type for a 2D IR dataset
This example compares a few explicit plotting methods available for the same infrared dataset.
import os
from pathlib import Path
import spectrochempy as scp
Load and prepare the dataset
TEST_FILE = Path(os.environ.get("TEST_FILE", "irdata/nh4y-activation.spg"))
dataset = scp.read(TEST_FILE)
dataset = dataset[:, 4000.0:650.0]
dataset.y -= dataset.y[0]
dataset.y.ito("hour")
dataset.y.title = "Time on stream"
dataset[:, 1290.0:920.0] = scp.MASKED
prefs = scp.preferences
prefs.figure.figsize = (7, 4)
Single-spectrum line plot
single = dataset[0]
_ = single.plot()

2D dataset plots
Explicit methods make the intended representation clear:
Customize plot options

This ends the example. Uncomment the next line to display the figures when running the script directly with Python.
# scp.show()
Total running time of the script: (0 minutes 3.588 seconds)


