View source: R/wavelength_calibration.R
| plot_wavelength_calibration | R Documentation |
Plots the offset of each reference line (reference minus measured wavelength) against its measured wavelength, with the fitted correction of each detector segment. Lines not used are drawn as open circles and labeled with the reason.
plot_wavelength_calibration(
object,
title = NULL,
xlab = "Measured wavelength (nm)",
ylab = "Reference - measured (nm)",
base_size = 11,
point_size = 2.5,
point_alpha = 1
)
object |
The result of |
title |
The plot title. |
xlab, ylab |
The axis titles. Default are |
base_size |
The size of the text, in points. Default is 11; the line labels scale with it. |
point_size |
The size of the points of the lines. Default is 2.5. |
point_alpha |
The opacity of the points, between 0 and 1. Default is 1. |
A ggplot object.
wavelength_calibration()
data(forageLIBS)
spectra <- forageLIBS[-(1:14)]
wl <- as.numeric(names(spectra))
first_detector <- spectra[seq_len(which(diff(wl) < 0)[1])]
reference <- c(`Mg I` = 285.213, `Ca II` = 317.933, `Ca II` = 393.366, `K I` = 404.414,
`Ca I` = 422.673, `Mg I` = 518.360, `Na I` = 588.995, `Ca I` = 643.907)
cal <- wavelength_calibration(first_detector, reference)
plot_wavelength_calibration(cal)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.