Vertical stripe with gradient fill
geom_gradient_vstripe.RdDisplays a vertical stripe that spans the entire height of the plot for each pair of x and xend values. Gradient goes from color fill to color fillend.
fill defaults the background color of the panel. fillend defaults to "darkgray". Optional alpha defaults to 1.
Usage
geom_gradient_vstripe(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
show.legend = NA,
inherit.aes = FALSE
)Arguments
- mapping
Set of aesthetic mappings created by
aes(). If specified andinherit.aes = TRUE(the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping.- data
The data to be displayed in this layer.
- stat
The statistical transformation to use on the data for this layer.
- position
A position adjustment to use on the data for this layer.
- ...
Other arguments passed on to
layer()'s params argument.- show.legend
logical. Should this layer be included in the legends?
- inherit.aes
If
FALSE, overrides the default aesthetics, rather than combining with them.
Examples
stripes_df <- data.frame(x = c(1, 2, 3), xend = c(2, 3, 4))
ggplot2::ggplot(stripes_df) + geom_gradient_vstripe(ggplot2::aes(x = x, xend = xend))