plot.Speclib | R Documentation |
Plot Speclib
in a new plot or adding it to an existing plot.
## S4 method for signature 'Speclib' plot(x, FUN = NULL, new = TRUE, ...)
x |
Object of class |
FUN |
Name of a function (character) or index or ID of single spectrum to plot (integer). |
new |
If FALSE the plot is added to active existing plot. |
... |
Further arguments passed to internal plot functions. |
The function may work in a couple of modes. The default way is to plot mean values (solid line) of all spectra and the standard deviations within bands. If data is assumed to be continuous the standard deviations are plotted as dashed lines otherwise error bars will indicate standard deviations.
The user has various options to change the way things are looking: With argument FUN
the name of a function, the ID or the index of a certain spectrum may be specified. Note that if FUN
is a function, this function will be applied to all spectra. If function should be applied to a subset of spectra, use function subset
to define rules excluding certain spectra.
By passing a subset, the user may specify a spectral range to plot. Limits for x- and y-axis will be found automatically or may be passed separately.
Lukas Lehnert
Speclib
data(spectral_data) ## Set mask for channel crossing and water absorption bands mask(spectral_data) <- c(1040, 1060, 1350, 1450) ## Simple example plot(spectral_data, legend = list(x = "topleft")) ## Example with function par(mfrow = c(2,3)) plot(spectral_data, FUN = "min", main = "Minimum of speclib") plot(spectral_data, FUN = "max", main = "Maximum of speclib") plot(spectral_data, FUN = "median", main = "Median of speclib") plot(spectral_data, FUN = "mean", main = "Mean of speclib") plot(spectral_data, FUN = "var", main = "Variance of speclib")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.