Learn R Programming

ggspectra (version 0.3.6)

set_annotations_default: Set defaults for autoplot annotations

Description

Set R options used when plotting spectra. Option "photobiology.plot.annotations" is used as default argument to formal parameter annotations and option "photobiology.plot.bands" is used as default argument to formal parameter w.band in all the autoplot() methods exported from package 'ggspectra'. These convenience functions makes it easier to edit these two option which are stored as a vector of characters strings and a list of waveband objects, respectively.

Usage

set_annotations_default(annotations = NULL)

set_w.band_default(w.band = NULL)

Arguments

annotations

character vector Annotations to add or remove from defaults used by the autoplot() methods defined in this package..

w.band

a single waveband object or a list of waveband objects.

Value

Previous value of option "photobiology.plot.annotations" returned invisibly.

Details

Vectors of character strings passed as argument to annotations are parsed so that if the first member string is "+", the remaining members are added to the current default for annotations; if it is "-" the remaining members are removed from the current default for annotations; and if it is "=" the remaining members become the new default. If the first member is none of these three strings, the whole vector becomes the new default. If annotations is NULL the annotations are reset to the package defaults. When removing annotations "title*", "peaks*" and "valleys*" will remove any variation of these annotations. The string "" means no annotations while "reserve.space" means no annotations but expand y scale to reserve space for annotations. These two values take precedence over any other values in the character vector. The order of the names of annotations has no meaning: the vector is interpreted as a set except for the three possible "operators" at position 1.

See Also

Other autoplot methods: autoplot.calibration_spct(), autoplot.cps_spct(), autoplot.filter_spct(), autoplot.object_spct(), autoplot.raw_spct(), autoplot.reflector_spct(), autoplot.response_spct(), autoplot.source_spct(), autoplot.waveband()