View source: R/geom_tshighlight.R
geom_tshighlight | R Documentation |
This is a version of [ggplot2::geom_rect()] that defaults to spanning the entirety of the y-axis.
geom_tshighlight( mapping = NULL, data = NULL, stat = "identity", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... |
Other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_tshighlight understands the following aesthetics (required aesthetics are in bold): - **xmin** - **xmax** - fill - color
ggplot(economics, aes(x = date, y = unemploy)) + geom_line() + geom_tshighlight(aes(xmin = as.Date("01/01/1990", format = "%d/%m/%Y"), xmax = as.Date("01/01/2000", format = "%d/%m/%Y")), alpha = 0.01)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.