View source: R/Viz2VarsVsLTime.R
| Viz2VarsVsLTime | R Documentation |
Plot two input variables that have the same dimensions in a common plot. One plot for all experiments. The input variables should have dimensions (nexp/nmod, nltime).
Viz2VarsVsLTime(
var1,
var2,
toptitle = "",
ytitle = "",
monini = 1,
freq = 12,
nticks = NULL,
limits = NULL,
listexp = c("exp1", "exp2", "exp3"),
listvars = c("var1", "var2"),
biglab = FALSE,
hlines = NULL,
drawleg = TRUE,
leg = NULL,
siglev = FALSE,
title_scale = 1,
sizetit = NULL,
show_conf = TRUE,
fileout = NULL,
width = 8,
height = 5,
size_units = "in",
res = 100,
...
)
var1 |
Matrix of dimensions (nexp/nmod, nltime). |
var2 |
Matrix of dimensions (nexp/nmod, nltime). |
toptitle |
Main title, optional. |
ytitle |
Title of Y-axis, optional. |
monini |
Starting month between 1 and 12. Default = 1. |
freq |
1 = yearly, 12 = monthly, 4 = seasonal, ... Default = 12. |
nticks |
Number of ticks and labels on the x-axis, optional. |
limits |
c(lower limit, upper limit): limits of the Y-axis, optional. |
listexp |
List of experiment names, up to three, optional. |
listvars |
List of names of input variables, optional. |
biglab |
TRUE/FALSE for presentation/paper plot. Default = FALSE. |
hlines |
c(a, b, ...) Add horizontal black lines at Y-positions a, b, ... The default value is NULL. |
drawleg |
TRUE/FALSE if legend should be added or not to the plot. Default = TRUE. |
leg |
Deprecated. Use 'drawleg' instead. |
siglev |
TRUE/FALSE if significance level should replace confidence
interval. |
title_scale |
Multiplicative factor to change title size, optional. |
sizetit |
Deprecated. Use 'title_scale' instead. |
show_conf |
TRUE/FALSE to show/not confidence intervals for input variables. |
fileout |
Name of output file. Extensions allowed: eps/ps, jpeg, png, pdf, bmp and tiff. The default value is NULL. |
width |
File width, in the units specified in the parameter size_units (inches by default). Takes 8 by default. |
height |
File height, in the units specified in the parameter size_units (inches by default). Takes 5 by default. |
size_units |
Units of the size of the device (file or window) to plot in. Inches ('in') by default. See ?Devices and the creator function of the corresponding device. |
res |
Resolution of the device (file or window) to plot in. See ?Devices and the creator function of the corresponding device. |
... |
Arguments to be passed to the method. Only accepts the following
graphical parameters: |
A figure in popup window by default, or saved to the specified path
via fileout.
clim <- s2dv::Clim(ts_temp$exp, ts_temp$obs, time_dim = "sdate",
dat_dim = c("dat", "member"))
ano_exp <- s2dv::Ano(ts_temp$exp, clim$clim_exp)
ano_obs <- s2dv::Ano(ts_temp$obs, clim$clim_obs)
corr_ano <- s2dv::Corr(s2dv::MeanDims(ano_exp, 'member'), ano_obs,
time_dim = 'sdate', dat_dim = 'dat')
input_cor <- array(dim = c(dat = 1, 3, time = 5))
input_cor[, 1, ] <- corr_ano$conf.lower[, 1, 1, ]
input_cor[, 2, ] <- corr_ano$corr[, 1, 1, ]
input_cor[, 3, ] <- corr_ano$conf.upper[, 1, 1, ]
rms_ano <- s2dv::RMS(s2dv::MeanDims(ano_exp, 'member'), ano_obs,
time_dim = 'sdate', dat_dim = 'dat')
input_rms <- array(dim = c(dat = 1, 3, time = 5))
input_rms[, 1, ] <- rms_ano$conf.lower[, 1, 1, ]
input_rms[, 2, ] <- rms_ano$rms[, 1, 1, ]
input_rms[, 3, ] <- rms_ano$conf.upper[, 1, 1, ]
Viz2VarsVsLTime(input_cor, input_rms,
toptitle = "Time correlation and RMSE with ERA5",
ytitle = "K", title_scale = 0.7,
monini = 11, freq = 1, limits = c(-1, 5),
listexp = c('SEAS5'), listvars = c('Corr', 'RMSE'),
fileout = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.