plot.waveband {ggspectra}R Documentation

Plot method for waveband objects.

Description

This function returns a ggplot object with an annotated plot of a waveband object.

Usage

## S3 method for class 'waveband'
plot(x, ..., w.length = NULL, range = c(280, 800),
  fill = 0, span = NULL,
  unit.in = getOption("photobiology.radiation.unit", default = "energy"),
  annotations = NULL, wb.trim = TRUE, norm = NULL, text.size = 2.5,
  na.rm = TRUE)

Arguments

x

a waveband object

...

other arguments passed to plot.response_spct()

w.length

numeric vector of wavelengths (nm)

range

an R object on which range() returns a vector of length 2, with min annd max wavelengths (nm)

fill

value to use as response for wavelngths outside the waveband range

span

a peak is defined as an element in a sequence which is greater than all other elements within a window of width span centered at that element.

unit.in

the type of unit we assume as reference "energy" or "photon" based

annotations

a character vector.

wb.trim

logical

norm

numeric normalization wavelength (nm) or character string "max" for normalization at the wavelength of highest peak.

text.size

numeric size of text in the plot decorations.

na.rm

logical.

Value

a ggplot object.

Note

Note that scales are expanded so as to make space for the annotations. The object returned is a ggplot object, and can be further manipulated.

Effectiveness spectra are plotted expressing the spectral effectiveness either as $1 mol^-1 nm$ photons of $1 J^-1 nm$ which can selected through formal argument unit.out. The value of unit.in has no effect on the result when uisng BSWFs, as BSWFs are defined based on a certain base of expression, which is enforced. In contrast, for wavebands which only define a wavelength range, changing the assumed reference irradiance, changes the responsivity according to Plank's law.

This function creates a response_spct object from the waveband object and plots it. Unused arguments are passed along, which means that other plot aspects can be controlled by providing arguments for the plot method of the response_spct class.

See Also

Other plot functions: plot.calibration_spct, plot.cps_spct, plot.filter_spct, plot.object_spct, plot.raw_spct, plot.reflector_spct, plot.response_spct, plot.source_spct

Examples

library(photobiology)
plot(waveband(c(400, 500)))


[Package ggspectra version 0.2.3 Index]