scale_*_exceed computes exceedance probabilities from a specified
distribution and maps onto a continuous gradient colour scale.
ScaleExceedscale_fill_exceed(
name = NULL,
palette = "Oranges",
type = "seq",
direction = 1,
dist_fun = NULL,
threshold = 1.64,
limits = c(0, 1),
na.value = NA,
guide = "colourbar",
aesthetics = "fill",
...
)
scale_colour_exceed(
name = NULL,
palette = "Oranges",
type = "seq",
direction = 1,
dist_fun = NULL,
threshold = 1.64,
limits = c(0, 1),
na.value = NA,
guide = "colourbar",
aesthetics = "colour",
...
)
A ScaleExceed ggproto object.
An object of class ScaleExceed (inherits from ScaleContinuous, Scale, ggproto, gg) of length 2.
The name of the scale. Used as the axis or legend title. If
waiver(), the default, the name of the scale is taken from the first
mapping used for that aesthetic. If NULL, the legend title will be
omitted.
A palette function that when called with a numeric vector with
values between 0 and 1 returns the corresponding output values
(e.g., scales::pal_area()).
One of "seq" (sequential), "div" (diverging) or "qual" (qualitative)
Sets the order of colours in the scale. If 1, the default,
colours are as output by RColorBrewer::brewer.pal(). If -1, the
order of colours is reversed.
A function used to compute the exceedance probability.
If NULL (the default), a normal distribution with stats::pnorm() is used.
A numeric value specifying the threshold q in the exceedance
probability expression P(X > q).
One of:
NULL to use the default scale range
A numeric vector of length two providing limits of the scale.
Use NA to refer to the existing minimum or maximum
A function that accepts the existing (automatic) limits and returns
new limits. Also accepts rlang lambda function
notation.
Note that setting limits on positional scales will remove data outside of the limits.
If the purpose is to zoom, use the limit argument in the coordinate system
(see coord_cartesian()).
Missing values will be replaced with this value.
A function used to create a guide or its name. See
guides() for more information.
The names of the aesthetics that this scale works with.
Other arguments passed to ggplot2::continuous_scale().
# Create an exceedance probability scale
sc <- scale_fill_exceed()
class(sc)
# Basic bivariate map
p <- ggplot(nc) + geom_sf(aes(fill = duo_exceed(value, sd)))
Run the code above in your browser using DataLab