R: Plot method for filter spectra.

plot.filter_spct {ggspectra} | R Documentation

## Plot method for filter spectra.

### Description

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

### Usage

    ## S3 method for class 'filter_spct'
    plot(x, ...,
      w.band = getOption("photobiology.plot.bands", default = list(UVC(), UVB(),
      UVA(), PAR())), range = NULL,
      plot.qty = getOption("photobiology.filter.qty", default = "transmittance"),
      pc.out = FALSE, label.qty = NULL, span = NULL, annotations = NULL,
      time.format = "", tz = "UTC", text.size = 2.5, na.rm = TRUE)

### Arguments

`x` | a filter_spct object
`...` | other arguments passed along, such as `label.qty`
`w.band` | a single waveband object or a list of waveband objects
`range` | an R object on which range() returns a vector of length 2, with min annd max wavelengths (nm)
`plot.qty` | character string one of "transmittance" or "absorbance"
`pc.out` | logical, if TRUE use percents instead of fraction of one
`label.qty` | character string giving the type of summary quantity to use for labels, one of "mean", "total", "contribution", and "relative".
`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.
`annotations` | a character vector
`time.format` | character Format as accepted by `strptime`.
`tz` | character Time zone to use for title and/or subtitle.
`text.size` | numeric size of text in the plot decorations.
`na.rm` | logical.

### Value

a `ggplot` object.

### Note

The ggplot object returned can be further manipulated and added to. Except when no annotations are added, limits are set for the x-axis and y-axis scales. The y scale limits are expanded to include all data, or at least to the range of expected values. The plotting of absorbance is an exception as the y-axis is not extended past 6 a.u. In the case of absorbance, values larger than 6 a.u. are rarely meaningful due to stray light during measurement. However, when transmittance values below the detection limit are rounded to zero, and later converted into absorbance, values Inf a.u. result, disrupting the plot. Scales are further expanded so as to make space for the annotations.

### See Also

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

### Examples

    library(photobiology)
    plot(yellow_gel.spct)
    plot(yellow_gel.spct, pc.out = TRUE)

[Package ggspectra version 0.2.3 Index]