diff --git a/R/stat-wb-box.R b/R/stat-wb-box.R index 9b2b04a..49285f7 100644 --- a/R/stat-wb-box.R +++ b/R/stat-wb-box.R @@ -2,7 +2,8 @@ #' #' \code{stat_wb_box} plots boxes corresponding to wavebands, by default located #' slightly above the peak of the spectrum. Sets suitable default aesthetics for -#' "rect" geom. +#' \code{geom_rect()}. \strong{\code{x}-scale transformations and axis +#' flipping are currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs @@ -88,8 +89,8 @@ #' scale_fill_identity() #' #' @note This stat uses a panel function and ignores grouping as it is meant to -#' be used for annotations.The value returned as default value for \code{y} is -#' based on the y-range of spectral values for the whole data set. +#' be used for annotations. The value returned as default value for \code{y} +#' is based on the y-range of spectral values for the whole data set. #' #' @export #' @family stats functions @@ -104,6 +105,7 @@ stat_wb_box <- function(mapping = NULL, ypos.mult = 1.07, ypos.fixed = NULL, box.height = 0.06, + w.band.transform = I, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) { @@ -115,6 +117,7 @@ stat_wb_box <- function(mapping = NULL, ypos.mult = ypos.mult, ypos.fixed = ypos.fixed, box.height = box.height, + w.band.transform = w.band.transform, na.rm = na.rm, ...) ) diff --git a/R/stat-wb-column.R b/R/stat-wb-column.R index ae8bbc6..4e72573 100644 --- a/R/stat-wb-column.R +++ b/R/stat-wb-column.R @@ -3,7 +3,8 @@ #' \code{stat_wb_column} computes means under a curve. It first integrates the #' area under a spectral curve and also the mean expressed per nanaometre of #' wavelength for each waveband in the input. Sets suitable default aesthetics -#' for "rect" geom. +#' for \code{geom_rect()}. \strong{\code{x}-scale transformations and axis +#' flipping are currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-contribution.R b/R/stat-wb-contribution.R index a9dbf8b..946376a 100644 --- a/R/stat-wb-contribution.R +++ b/R/stat-wb-contribution.R @@ -1,10 +1,13 @@ #' Integrate ranges under spectral curve. #' -#' \code{stat_wb_contribution} computes means under a curve. It first integrates the -#' area under a spectral curve and also the mean expressed per nanaometre of -#' wavelength for each waveband in the input. Sets suitable default aesthetics -#' for "rect", "hline", "vline", "text" and "label" geoms displaying "contributions" -#' per waveband to the total of the spectral integral. +#' \code{stat_wb_contribution} integrates the area under a spectral curve. It +#' first integrates the area under the curve for each waveband and for the whole +#' curve and then expresses the integral for each band as a relative +#' contribution to the area under the whole spectral curve. Sets suitable +#' default aesthetics for "rect", "hline", "vline", "text" and "label" geoms +#' displaying "contributions" per waveband to the total of the spectral +#' integral. \strong{\code{x}-scale transformations and axis flipping are +#' currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-hbar.R b/R/stat-wb-hbar.R index d2ecb4f..06e367c 100644 --- a/R/stat-wb-hbar.R +++ b/R/stat-wb-hbar.R @@ -4,7 +4,8 @@ #' area under a spectral curve and also the mean expressed per nanaometre of #' wavelength for each waveband in the input. Sets suitable default aesthetics #' for geoms "errorbarh" and "hline" from 'ggplot', and "linerangeh", -#' and "errorbarh" from 'ggstance'. +#' and "errorbarh" from 'ggstance'. \strong{\code{x}-scale transformations and +#' axis flipping are currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-irrad.R b/R/stat-wb-irrad.R index 18eb615..5b2c3f9 100644 --- a/R/stat-wb-irrad.R +++ b/R/stat-wb-irrad.R @@ -1,6 +1,10 @@ #' Integrate irradiance for wavebands. #' -#' \code{stat_wb_irrad} computes areas under a curve. +#' \code{stat_wb_irrad} integrates the area under a spectral irradiance curve, +#' yielding energy or photon irradiance. The range(s) of wavelengths to +#' integrate are set with a list of \code{waveband} objects. +#' \strong{\code{x}-scale transformations and axis flipping are currently not +#' supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-label.R b/R/stat-wb-label.R index 412fb70..32dbfb4 100644 --- a/R/stat-wb-label.R +++ b/R/stat-wb-label.R @@ -1,8 +1,9 @@ #' Label ranges under spectral curve. #' -#' \code{stat_wb_label} computes computes the center of a waveband. Sets -#' suitable default aesthetics for "text" and "label" -#' geoms displaying "boundaries" and "names" of wavebands. +#' \code{stat_wb_label} computes the center of a waveband. Sets suitable default +#' aesthetics for "text" and "label" geoms displaying "boundaries" and "names" +#' of wavebands. \strong{\code{x}-scale transformations and axis flipping are +#' currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-mean.R b/R/stat-wb-mean.R index cf150af..46c879a 100644 --- a/R/stat-wb-mean.R +++ b/R/stat-wb-mean.R @@ -1,9 +1,9 @@ #' Integrate ranges under curve. #' -#' \code{stat_wb_mean} computes means under a curve. It first integrates the -#' area under a spectral curve and also the mean expressed per nanaometre of -#' wavelength for each waveband in the input. Sets suitable default aesthetics -#' for "rect", "hline", "vline", "text" and "label" geoms. +#' \code{stat_wb_mean} computes mean spectral irradiance under a curve for each +#' waveband in the input. Sets suitable default aesthetics for "rect", "hline", +#' "vline", "text" and "label" geoms. \strong{\code{x}-scale transformations +#' and axis flipping are currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-relative.R b/R/stat-wb-relative.R index 9f0335c..70f47e1 100644 --- a/R/stat-wb-relative.R +++ b/R/stat-wb-relative.R @@ -1,10 +1,11 @@ #' Integrate ranges under spectral curve. #' -#' \code{stat_wb_relative} computes means under a curve. It first integrates the -#' area under a spectral curve and also the mean expressed per nanaometre of -#' wavelength for each waveband in the input. Sets suitable default aesthetics -#' for "rect", "hline", "vline", "text" and "label" geoms displaying -#' values per waveband "relative" to the sum of the wavebands. +#' \code{stat_wb_relative} computes relative-irradiances under a curve. It first +#' integrates the area under the spectral curve for each waveband in the input, +#' and expresses these irradianses relative to their sum. Sets suitable default +#' aesthetics for "rect", "hline", "vline", "text" and "label" geoms. +#' \strong{\code{x}-scale transformations and axis flipping are currently not +#' supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-sirrad.R b/R/stat-wb-sirrad.R index 367ecae..f147f8c 100644 --- a/R/stat-wb-sirrad.R +++ b/R/stat-wb-sirrad.R @@ -1,6 +1,10 @@ #' Integrate spectral irradiance for wavebands. #' -#' \code{stat_wb_sirrad} computes areas under a curve. +#' \code{stat_wb_sirrad} computes the mean spectral irradiance under a curve, +#' yielding energy or photon spectral irradiance. The range(s) of wavelengths to +#' integrate are set with a list of \code{waveband} objects. +#' \strong{\code{x}-scale transformations and axis flipping are currently not +#' supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wb-total.R b/R/stat-wb-total.R index f0336a4..545bec8 100644 --- a/R/stat-wb-total.R +++ b/R/stat-wb-total.R @@ -1,10 +1,9 @@ #' Integrate ranges under spectral curve. #' -#' \code{stat_wb_total} computes integral under a curve. It first integrates the -#' area under a spectral curve and also the mean expressed per nanaometre of -#' wavelength for each waveband in the input. Sets suitable default aesthetics -#' for "rect", "hline", "vline", "text" and "label" geoms displaying "totals" -#' per waveband. +#' \code{stat_wb_total} computes integral under a curve. Sets suitable default +#' aesthetics for "rect", "hline", "vline", "text" and "label" geoms displaying +#' "totals" per waveband. \strong{\code{x}-scale transformations and axis +#' flipping are currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with #' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs diff --git a/R/stat-wl-strip.R b/R/stat-wl-strip.R index 581bb75..0635c0f 100644 --- a/R/stat-wl-strip.R +++ b/R/stat-wl-strip.R @@ -1,30 +1,33 @@ #' Calculate colours from wavelength. #' -#' \code{stat_wl_strip} computes color definitions according to human vision. +#' \code{stat_wl_strip} computes color definitions according to human vision and +#' by default plots a narrow, guide-like colour gradient strip based on +#' wavelength. \strong{\code{x}-scale transformations and axis flipping are +#' currently not supported}. #' #' @param mapping The aesthetic mapping, usually constructed with -#' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs to be set -#' at the layer level if you are overriding the plot defaults. +#' \code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs to be +#' set at the layer level if you are overriding the plot defaults. #' @param data A layer specific dataset - only needed if you want to override -#' the plot defaults. -#' @param geom The geometric object to use display the data -#' @param position The position adjustment to use for overlapping points -#' on this layer +#' the plot defaults. +#' @param geom The geometric object to use display the data. +#' @param position The position adjustment to use for overlapping points on this +#' layer. #' @param show.legend logical. Should this layer be included in the legends? -#' \code{NA}, the default, includes if any aesthetics are mapped. -#' \code{FALSE} never includes, and \code{TRUE} always includes. -#' @param inherit.aes If \code{FALSE}, overrides the default aesthetics, -#' rather than combining with them. This is most useful for helper functions -#' that define both data and aesthetics and shouldn't inherit behaviour from -#' the default plot specification, e.g. \code{\link[ggplot2]{borders}}. -#' @param ... other arguments passed on to \code{\link[ggplot2]{layer}}. This can -#' include aesthetics whose values you want to set, not map. See +#' \code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} +#' never includes, and \code{TRUE} always includes. +#' @param inherit.aes If \code{FALSE}, overrides the default aesthetics, rather +#' than combining with them. This is most useful for helper functions that +#' define both data and aesthetics and shouldn't inherit behaviour from the +#' default plot specification, e.g. \code{\link[ggplot2]{borders}}. +#' @param ... other arguments passed on to \code{\link[ggplot2]{layer}}. This +#' can include aesthetics whose values you want to set, not map. See #' \code{\link[ggplot2]{layer}} for more details. -#' @param na.rm a logical value indicating whether NA values should be -#' stripped before the computation proceeds. +#' @param na.rm a logical value indicating whether NA values should be stripped +#' before the computation proceeds. #' @param w.band waveband object or a list of such objects or NULL. -#' @param length.out The number of steps to use to simulate a continuous -#' range of colours when w.band == NULL. +#' @param length.out The number of steps to use to simulate a continuous range +#' of colours when w.band == NULL. #' @param chroma.type character one of "CMF" (color matching function) or "CC" #' (color coordinates) or a \code{\link[photobiology]{chroma_spct}} object. #' @@ -65,12 +68,15 @@ #' @examples #' #' # ggplot() methods for spectral objects set a default mapping for x and y. -#' ggplot(sun.spct) + geom_line() + +#' ggplot(sun.spct) + +#' geom_line() + #' stat_wl_strip(ymax = -0.02, ymin = -0.04) + #' scale_fill_identity() #' #' # on some graphic devices the output may show spurious vertical lines -#' ggplot(sun.spct) + wl_guide(alpha = 0.33, color = NA) + geom_line() +#' ggplot(sun.spct) + +#' wl_guide(alpha = 0.33, color = NA) + +#' geom_line() #' #' @export #' @family stats functions @@ -133,16 +139,16 @@ StatColorGuide <- #' wl_guide <- function(mapping = NULL, data = NULL, + position = "identity", + ..., chroma.type = "CMF", w.band = NULL, length.out = 150, ymin = -Inf, ymax = Inf, - position = "identity", na.rm = FALSE, show.legend = FALSE, - inherit.aes = TRUE, - ...) { + inherit.aes = TRUE) { list(stat_wl_strip(mapping = mapping, data = data, geom = "rect", diff --git a/man/geom_spct.Rd b/man/geom_spct.Rd index b5f0778..612a1f2 100644 --- a/man/geom_spct.Rd +++ b/man/geom_spct.Rd @@ -9,10 +9,10 @@ geom_spct( data = NULL, stat = "identity", position = "identity", + ..., na.rm = FALSE, show.legend = NA, - inherit.aes = TRUE, - ... + inherit.aes = TRUE ) } \arguments{ @@ -29,6 +29,10 @@ as a string.} \item{position}{Position adjustment, either as a string, or the result of a call to a position adjustment function.} +\item{...}{other arguments passed on to \code{\link[ggplot2]{layer}}. This +can include aesthetics whose values you want to set, not map. See +\code{\link[ggplot2]{layer}} for more details.} + \item{na.rm}{If FALSE (the default), removes missing values with a warning. If TRUE silently removes missing values.} @@ -40,10 +44,6 @@ never includes, and \code{TRUE} always includes.} than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. \code{\link[ggplot2]{borders}}.} - -\item{...}{other arguments passed on to \code{\link[ggplot2]{layer}}. This -can include aesthetics whose values you want to set, not map. See -\code{\link[ggplot2]{layer}} for more details.} } \description{ For each continuous x value, \code{geom_spct} displays a y interval. diff --git a/man/stat_wb_box.Rd b/man/stat_wb_box.Rd index ed7e6f2..c762346 100644 --- a/man/stat_wb_box.Rd +++ b/man/stat_wb_box.Rd @@ -15,6 +15,7 @@ stat_wb_box( ypos.mult = 1.07, ypos.fixed = NULL, box.height = 0.06, + w.band.transform = I, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE @@ -73,12 +74,13 @@ trimmed or discarded. \description{ \code{stat_wb_box} plots boxes corresponding to wavebands, by default located slightly above the peak of the spectrum. Sets suitable default aesthetics for -"rect" geom. +\code{geom_rect()}. \strong{\code{x}-scale transformations and axis + flipping are currently not supported}. } \note{ This stat uses a panel function and ignores grouping as it is meant to - be used for annotations.The value returned as default value for \code{y} is - based on the y-range of spectral values for the whole data set. + be used for annotations. The value returned as default value for \code{y} + is based on the y-range of spectral values for the whole data set. } \section{Computed variables}{ diff --git a/man/stat_wb_column.Rd b/man/stat_wb_column.Rd index 2d21fc2..aabb419 100644 --- a/man/stat_wb_column.Rd +++ b/man/stat_wb_column.Rd @@ -64,7 +64,8 @@ trimmed or discarded. \code{stat_wb_column} computes means under a curve. It first integrates the area under a spectral curve and also the mean expressed per nanaometre of wavelength for each waveband in the input. Sets suitable default aesthetics - for "rect" geom. + for \code{geom_rect()}. \strong{\code{x}-scale transformations and axis + flipping are currently not supported}. } \note{ If the argument passed to \code{w.band} is a BSWF it is silently diff --git a/man/stat_wb_contribution.Rd b/man/stat_wb_contribution.Rd index 3cd5b9b..4bf7347 100644 --- a/man/stat_wb_contribution.Rd +++ b/man/stat_wb_contribution.Rd @@ -78,11 +78,14 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_contribution} computes means under a curve. It first integrates the - area under a spectral curve and also the mean expressed per nanaometre of - wavelength for each waveband in the input. Sets suitable default aesthetics - for "rect", "hline", "vline", "text" and "label" geoms displaying "contributions" - per waveband to the total of the spectral integral. +\code{stat_wb_contribution} integrates the area under a spectral curve. It +first integrates the area under the curve for each waveband and for the whole +curve and then expresses the integral for each band as a relative +contribution to the area under the whole spectral curve. Sets suitable +default aesthetics for "rect", "hline", "vline", "text" and "label" geoms +displaying "contributions" per waveband to the total of the spectral +integral. \strong{\code{x}-scale transformations and axis flipping are +currently not supported}. } \section{Computed variables}{ diff --git a/man/stat_wb_hbar.Rd b/man/stat_wb_hbar.Rd index 529b798..156a1a5 100644 --- a/man/stat_wb_hbar.Rd +++ b/man/stat_wb_hbar.Rd @@ -69,7 +69,8 @@ A data frame with one row for each waveband object in the argument to area under a spectral curve and also the mean expressed per nanaometre of wavelength for each waveband in the input. Sets suitable default aesthetics for geoms "errorbarh" and "hline" from 'ggplot', and "linerangeh", -and "errorbarh" from 'ggstance'. +and "errorbarh" from 'ggstance'. \strong{\code{x}-scale transformations and +axis flipping are currently not supported}. } \note{ If the argument passed to \code{w.band} is a BSWF it is silently diff --git a/man/stat_wb_irrad.Rd b/man/stat_wb_irrad.Rd index dad4dd5..ca15364 100644 --- a/man/stat_wb_irrad.Rd +++ b/man/stat_wb_irrad.Rd @@ -126,7 +126,11 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_irrad} computes areas under a curve. +\code{stat_wb_irrad} integrates the area under a spectral irradiance curve, +yielding energy or photon irradiance. The range(s) of wavelengths to +integrate are set with a list of \code{waveband} objects. +\strong{\code{x}-scale transformations and axis flipping are currently not +supported}. } \section{Computed variables}{ diff --git a/man/stat_wb_label.Rd b/man/stat_wb_label.Rd index 4f0916a..81a0a39 100644 --- a/man/stat_wb_label.Rd +++ b/man/stat_wb_label.Rd @@ -67,9 +67,10 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_label} computes computes the center of a waveband. Sets -suitable default aesthetics for "text" and "label" -geoms displaying "boundaries" and "names" of wavebands. +\code{stat_wb_label} computes the center of a waveband. Sets suitable default +aesthetics for "text" and "label" geoms displaying "boundaries" and "names" +of wavebands. \strong{\code{x}-scale transformations and axis flipping are +currently not supported}. } \note{ This stat uses a panel function and ignores grouping as it is meant to diff --git a/man/stat_wb_mean.Rd b/man/stat_wb_mean.Rd index 86c44e5..21578da 100644 --- a/man/stat_wb_mean.Rd +++ b/man/stat_wb_mean.Rd @@ -79,10 +79,10 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_mean} computes means under a curve. It first integrates the - area under a spectral curve and also the mean expressed per nanaometre of - wavelength for each waveband in the input. Sets suitable default aesthetics - for "rect", "hline", "vline", "text" and "label" geoms. +\code{stat_wb_mean} computes mean spectral irradiance under a curve for each +waveband in the input. Sets suitable default aesthetics for "rect", "hline", +"vline", "text" and "label" geoms. \strong{\code{x}-scale transformations +and axis flipping are currently not supported}. } \section{Computed variables}{ diff --git a/man/stat_wb_relative.Rd b/man/stat_wb_relative.Rd index c874f75..828d2a0 100644 --- a/man/stat_wb_relative.Rd +++ b/man/stat_wb_relative.Rd @@ -78,11 +78,12 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_relative} computes means under a curve. It first integrates the - area under a spectral curve and also the mean expressed per nanaometre of - wavelength for each waveband in the input. Sets suitable default aesthetics - for "rect", "hline", "vline", "text" and "label" geoms displaying - values per waveband "relative" to the sum of the wavebands. +\code{stat_wb_relative} computes relative-irradiances under a curve. It first +integrates the area under the spectral curve for each waveband in the input, +and expresses these irradianses relative to their sum. Sets suitable default +aesthetics for "rect", "hline", "vline", "text" and "label" geoms. +\strong{\code{x}-scale transformations and axis flipping are currently not +supported}. } \section{Computed variables}{ diff --git a/man/stat_wb_sirrad.Rd b/man/stat_wb_sirrad.Rd index e8620a4..fdc2787 100644 --- a/man/stat_wb_sirrad.Rd +++ b/man/stat_wb_sirrad.Rd @@ -129,7 +129,11 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_sirrad} computes areas under a curve. +\code{stat_wb_sirrad} computes the mean spectral irradiance under a curve, +yielding energy or photon spectral irradiance. The range(s) of wavelengths to +integrate are set with a list of \code{waveband} objects. +\strong{\code{x}-scale transformations and axis flipping are currently not +supported}. } \section{Computed variables}{ diff --git a/man/stat_wb_total.Rd b/man/stat_wb_total.Rd index 18d9a6c..b66441b 100644 --- a/man/stat_wb_total.Rd +++ b/man/stat_wb_total.Rd @@ -78,11 +78,10 @@ to \code{w.band}. Wavebeand outside the range of the spectral data are trimmed or discarded. } \description{ -\code{stat_wb_total} computes integral under a curve. It first integrates the - area under a spectral curve and also the mean expressed per nanaometre of - wavelength for each waveband in the input. Sets suitable default aesthetics - for "rect", "hline", "vline", "text" and "label" geoms displaying "totals" - per waveband. +\code{stat_wb_total} computes integral under a curve. Sets suitable default +aesthetics for "rect", "hline", "vline", "text" and "label" geoms displaying +"totals" per waveband. \strong{\code{x}-scale transformations and axis +flipping are currently not supported}. } \section{Computed variables}{ diff --git a/man/stat_wl_strip.Rd b/man/stat_wl_strip.Rd index 2c6ad10..4114f40 100644 --- a/man/stat_wl_strip.Rd +++ b/man/stat_wl_strip.Rd @@ -22,54 +22,54 @@ stat_wl_strip( wl_guide( mapping = NULL, data = NULL, + position = "identity", + ..., chroma.type = "CMF", w.band = NULL, length.out = 150, ymin = -Inf, ymax = Inf, - position = "identity", na.rm = FALSE, show.legend = FALSE, - inherit.aes = TRUE, - ... + inherit.aes = TRUE ) } \arguments{ \item{mapping}{The aesthetic mapping, usually constructed with -\code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs to be set -at the layer level if you are overriding the plot defaults.} +\code{\link[ggplot2]{aes}} or \code{\link[ggplot2]{aes_}}. Only needs to be +set at the layer level if you are overriding the plot defaults.} \item{data}{A layer specific dataset - only needed if you want to override the plot defaults.} -\item{geom}{The geometric object to use display the data} +\item{geom}{The geometric object to use display the data.} -\item{position}{The position adjustment to use for overlapping points -on this layer} +\item{position}{The position adjustment to use for overlapping points on this +layer.} -\item{...}{other arguments passed on to \code{\link[ggplot2]{layer}}. This can -include aesthetics whose values you want to set, not map. See +\item{...}{other arguments passed on to \code{\link[ggplot2]{layer}}. This +can include aesthetics whose values you want to set, not map. See \code{\link[ggplot2]{layer}} for more details.} \item{w.band}{waveband object or a list of such objects or NULL.} -\item{length.out}{The number of steps to use to simulate a continuous -range of colours when w.band == NULL.} +\item{length.out}{The number of steps to use to simulate a continuous range +of colours when w.band == NULL.} \item{chroma.type}{character one of "CMF" (color matching function) or "CC" (color coordinates) or a \code{\link[photobiology]{chroma_spct}} object.} -\item{na.rm}{a logical value indicating whether NA values should be -stripped before the computation proceeds.} +\item{na.rm}{a logical value indicating whether NA values should be stripped +before the computation proceeds.} \item{show.legend}{logical. Should this layer be included in the legends? -\code{NA}, the default, includes if any aesthetics are mapped. -\code{FALSE} never includes, and \code{TRUE} always includes.} +\code{NA}, the default, includes if any aesthetics are mapped. \code{FALSE} +never includes, and \code{TRUE} always includes.} -\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, -rather than combining with them. This is most useful for helper functions -that define both data and aesthetics and shouldn't inherit behaviour from -the default plot specification, e.g. \code{\link[ggplot2]{borders}}.} +\item{inherit.aes}{If \code{FALSE}, overrides the default aesthetics, rather +than combining with them. This is most useful for helper functions that +define both data and aesthetics and shouldn't inherit behaviour from the +default plot specification, e.g. \code{\link[ggplot2]{borders}}.} \item{ymin, ymax}{numeric used as aesthetics for plotting the guide.} } @@ -78,7 +78,10 @@ generic_spect object with new \code{x} values plus other computed variables described below. } \description{ -\code{stat_wl_strip} computes color definitions according to human vision. +\code{stat_wl_strip} computes color definitions according to human vision and +by default plots a narrow, guide-like colour gradient strip based on +wavelength. \strong{\code{x}-scale transformations and axis flipping are +currently not supported}. } \note{ This stat uses a panel function and ignores grouping as it is meant to @@ -119,12 +122,15 @@ Required by the statistic and need to be set with \code{aes()}. \examples{ # ggplot() methods for spectral objects set a default mapping for x and y. -ggplot(sun.spct) + geom_line() + +ggplot(sun.spct) + + geom_line() + stat_wl_strip(ymax = -0.02, ymin = -0.04) + scale_fill_identity() # on some graphic devices the output may show spurious vertical lines -ggplot(sun.spct) + wl_guide(alpha = 0.33, color = NA) + geom_line() +ggplot(sun.spct) + + wl_guide(alpha = 0.33, color = NA) + + geom_line() } \seealso{