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 spectrochempy as scp

Load and prepare the dataset#

dataset = scp.read("irdata/nh4y-activation.spg")
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#

plot plot types

2D dataset plots#

Explicit methods make the intended representation clear:

_ = dataset.plot_lines()
_ = dataset.plot_image(colorbar=True)
_ = dataset.plot_contour(colorbar=True)
  • plot plot types
  • plot plot types
  • plot plot types

Customize plot options#

_ = dataset.plot_image(
    cmap="plasma",
    xlim=(2000, 1300),
    ylim=(1, 5),
    colorbar=True,
)
plot plot types

Uncomment the following line to display all figures when running the script directly with Python.

# scp.show()

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