Plot different "climate stripes" or "warming stripes" using ggplot2. These graphics are visual representations of the change in temperature as measured in each location over the past 70-100+ years. Each stripe represents the temperature in that station averaged over a year.
Arguments
- data
A data.frame with date (
year) and temperature (temp) variables.- plot_type
Plot type. Accepted values are
"background","stripes","trend"or"animation".- plot_title
Character string to be used for the plot title.
- n_temp
Numeric value with the number of colors of the palette. (default
11).- col_pal
Character string indicating the name of the
hcl.pals()color palette to be used for plotting.- ...
Further arguments passed to
ggplot2::theme().
Value
A ggplot2 object. See help("ggplot2").
Note
"Warming stripes" charts are a conceptual idea of Professor Ed Hawkins (University of Reading) and are specifically designed to be as simple as possible and to warn about climate change risks. For more details, see ShowYourStripes.
API key
You need to set your API key globally using aemet_api_key().
Query timeout can be controlled with
options(climaemet_timeout = 60) (default value). See
httr2::req_timeout() for details.
See also
climatestripes_station(), ggplot2::theme() for more possible
arguments to pass to ggstripes().
Plotting functions:
climatestripes_station(),
climatogram_normal(),
climatogram_period(),
ggclimat_walter_lieth(),
ggwindrose(),
windrose_days(),
windrose_period()
Warming stripes functions:
climaemet_9434_temp,
climatestripes_station()
Examples
# \donttest{
library(ggplot2)
data <- climaemet::climaemet_9434_temp
ggstripes(data, plot_title = "Zaragoza Airport") +
labs(subtitle = "(1950-2020)")
#> ℹ Plotting climate stripes.
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_tile()`).
ggstripes(data, plot_title = "Zaragoza Airport", plot_type = "trend") +
labs(subtitle = "(1950-2020)")
#> ℹ Plotting climate stripes with temperature line trend.
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_tile()`).
# }
