plot_models_and_climate_data | R Documentation |
Readily displays annotated climate time series (usually temperature) on a common plot along with CMIP Phase 3 or Phase 5 model projections.
plot_models_and_climate_data(
instrumental,
models,
series = NULL,
scenario = NULL,
start = 1880,
end = NULL,
ma = NULL,
ma_i = ma,
baseline = NULL,
yearly = FALSE,
ma_sides = 1L,
ylim = c(-1, 1),
bg = scales::alpha("gray", 0.1),
scenario_text = "Scenario Realizations",
center_fun = "mean",
smooth_center = FALSE,
envelope_coverage = 0.95,
envelope_type = c("quantiles", "range", "normal"),
plot_envelope = TRUE,
smooth_envelope = TRUE,
smooth_span = NULL,
unit = NULL,
col_m = NULL,
col_m_mean = NULL,
alpha_envelope = 0.1,
envelope_text = "model coverage",
legend... = list(),
plot_i... = list(),
col_i_fun = colorspace::rainbow_hcl,
col_i_fun... = list(l = 65),
alpha_i = 0.9,
conf_int_i = FALSE,
ci_alpha_i = 0.3,
make_standardized_plot_filename... = list(),
start_callback = NULL,
sign = TRUE,
sign_callback = rlang::expr(text(graphics::par("usr")[2], graphics::par("usr")[3],
labels = "@priscian", adj = c(1, -0.5))),
end_callback = NULL,
save_png = FALSE,
save_png_dir,
png... = list(),
...
)
instrumental |
An instrumental-temperature dataset (down)loaded by function |
models |
A modeled-temperature dataset loaded by function |
series |
A vector containing the column names of the instrumental temperature series to be plotted. If |
scenario |
A character vector corresponding to specific radiative-forcing pathways represented in subsets of the modeled temperature data. If |
start , end |
Integer values of the starting and ending years of the plot, respectively; if either is given as |
ma , ma_i |
The sizes in months of the moving averages for smoothing the modeled and instrumental temperature series, respectively. If |
baseline |
An integer year or, more typically, range of years on which the temperature anomalies will be centered. If |
ylim |
The y limits of the plot, i.e. the plot range of the temperature anomalies. |
center_fun |
The function used to calculate the central tendency of the model runs at each time point; the default of |
smooth_center |
Logical; if |
envelope_coverage |
Sets the "coverage" of the models-envelope calculated as |
envelope_type |
A character vector matching one of several methods (e.g. "quantiles", "range", "normal") for calculating the |
plot_envelope |
Logical; if |
smooth_envelope |
Logical; if |
col_m |
A vector of colors for each model scenario. If |
col_m_mean |
The color of the central-tendency line for all the included model runs. The default of |
alpha_envelope |
Sets the color transparency of the model envelopes to a new level in [0, 1]. If |
legend... |
Takes a list of arguments to be passed to function |
plot_i... |
Takes a list of arguments to be passed to function |
col_i_fun |
A color palette for |
col_i_fun... |
Takes a list of arguments to be passed to function |
alpha_i |
Sets the color transparency of the temperature series to a new level in [0, 1]. If |
conf_int_i |
Logical; if |
ci_alpha_i |
Sets the color transparency of the temperature-series CIs to a new level in [0, 1]. If |
... |
Passed to |
omit_series |
A vector containing the column names of the climate series NOT to be plotted if |
## Not run:
inst <- get_climate_data(download=FALSE, baseline=TRUE)
cmip5 <- get_models_data(ensemble="cmip5", baseline=1981:2010, save=FALSE) # Load CMIP5 data from combined R data set.
## Plot all CMIP5 scenario realizations, no instrumental temperature series.
plot_models_and_climate_data(inst, cmip5, series=NA, scenario=NULL, start=1950, end=2100, ma=12, baseline=NULL,
center_fun="mean", smooth_envelope=TRUE, col_m_mean="red", ylim=c(-1, 5))
## CMIP5 RCP 4.5 scenario realizations compared to the GISTEMP land+SST series.
series <- c("GISTEMP Global")
plot_models_and_climate_data(inst, cmip5, series=series, scenario="RCP 4.5", start=1880, end=2020, ma=12, ma_i=12,
baseline=1951:1980, center_fun="mean", smooth_envelope=TRUE, envelope_type="quantiles", envelope_text="quantiles",
ylim=c(-1.0, 1.5), conf_int_i=FALSE, col_i_fun="topo.colors", col_i_fun...=list())
## Same plot, different baseline:
plot_models_and_climate_data(inst, cmip5, series=series, scenario="RCP 4.5", start=1880, end=2020, ma=12, ma_i=12,
baseline=1981:2010, center_fun="mean", smooth_envelope=TRUE, envelope_type="quantiles", envelope_text="quantiles",
ylim=c(-1.5, 1.0), conf_int_i=TRUE, col_i_fun=function(...) "red")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.