library(spectrolab)
spec = as_spectra(spec_matrix_example, name_idx = 1)
plot_regions(spec, default_spec_regions())
plot(spec, add = TRUE)
# Alternatively, if you want to get fancy...
if (FALSE) {
col_fun = colorRampPalette(c(rgb(1, 1, 0, 0.7),rgb(1, 0, 0, 0.7)), alpha = TRUE)
colors = col_fun(4)
plot_regions(spec,default_spec_regions(), col = colors)
plot(spec, add = TRUE)
}
Run the code above in your browser using DataLab