Plot a grid of spectra grouped by classification
This is an example showing how to produce a grid of line plots of an array of spectra labelled with a classification.
First we shall create a random array of spectra each labelled with a random classifications. Usually you would provide your own set of hand labelled spectra taken from spectral imaging observations of the Sun.
Next, we shall import
from mcalf.visualisation import plot_classifications
We can now plot a simple grid of the spectra grouped by their classification. By default, a maximum of 20 spectra are plotted for each classification. The first 20 spectra are selected.
A specific number of rows or columns can be requested,
The plot settings can be adjusted,
By default, the y-axis goes from 0 to 1. This is because labelled training data will typically be rescaled between 0 and 1. However, if a particular classification has spectra that are not within 0 and 1, the y-axis limits are determined by matplotlib.
Total running time of the script: ( 0 minutes 0.654 seconds)