Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Plot2VarsVsLTime

Plot Two Scores With Confidence Intervals In A Common Plot


Description

Plots two input variables having the same dimensions in a common plot.
One plot for all experiments.
Input variables should have dimensions (nexp/nmod, nltime).

Usage

Plot2VarsVsLTime(
  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,
  leg = TRUE,
  siglev = FALSE,
  sizetit = 1,
  show_conf = TRUE,
  fileout = "output_plot2varsvsltime.eps",
  width = 8,
  height = 5,
  size_units = "in",
  res = 100,
  ...
)

Arguments

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, ...
Default: NULL.

leg

TRUE/FALSE if legend should be added or not to the plot. Default = TRUE.

siglev

TRUE/FALSE if significance level should replace confidence interval.
Default = FALSE.

sizetit

Multiplicative factor to change title size, optional.

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.
Default = 'output_plot2varsvsltime.eps'

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:
adj ann ask bg bty cex.sub cin col.axis col.lab col.main col.sub cra crt csi cxy err family fg fig font font.axis font.lab font.main font.sub lend lheight ljoin lmitre mar mex mfcol mfrow mfg mkh oma omd omi page pch plt smo srt tck tcl usr xaxp xaxs xaxt xlog xpd yaxp yaxs yaxt ylbias ylog
For more information about the parameters see 'par'.

Details

Examples of input:
——————

RMSE error for a number of experiments and along lead-time: (nexp, nltime)

Author(s)

History:
1.0 - 2013-03 (I. Andreu-Burillo, isabel.andreu-burillo@ic3.cat) - Original code

Examples

# Load sample data as in Load() example:
example(Load)
clim <- Clim(sampleData$mod, sampleData$obs)
ano_exp <- Ano(sampleData$mod, clim$clim_exp)
ano_obs <- Ano(sampleData$obs, clim$clim_obs)
runmean_months <- 12
dim_to_smooth <- 4  # Smooth along lead-times
smooth_ano_exp <- Smoothing(ano_exp, runmean_months, dim_to_smooth)
smooth_ano_obs <- Smoothing(ano_obs, runmean_months, dim_to_smooth)
dim_to_mean <- 2  # Mean along members
required_complete_row <- 3  # Discard start dates that contain NA along lead-times
leadtimes_per_startdate <- 60
rms <- RMS(Mean1Dim(smooth_ano_exp, dim_to_mean), 
          Mean1Dim(smooth_ano_obs, dim_to_mean), 
          compROW = required_complete_row, 
          limits = c(ceiling((runmean_months + 1) / 2), 
                     leadtimes_per_startdate - floor(runmean_months / 2)))
smooth_ano_exp_m_sub <- smooth_ano_exp - InsertDim(Mean1Dim(smooth_ano_exp, 2, 
                       narm = TRUE), 2, dim(smooth_ano_exp)[2])
spread <- Spread(smooth_ano_exp_m_sub, c(2, 3))  
 
Plot2VarsVsLTime(InsertDim(rms[, , , ], 1, 1), spread$sd, 
                toptitle = 'RMSE and spread', monini = 11, freq = 12, 
                listexp = c('CMIP5 IC3'), listvar = c('RMSE', 'spread'),
                fileout = 'plot2vars.eps')

s2dverification

Set of Common Tools for Forecast Verification

v2.10.0
Apache License 2.0
Authors
BSC-CNS [aut, cph], Virginie Guemas [aut], Nicolau Manubens [aut], An-Chi Ho [ctb, cre], Nuria Perez-Zanon [ctb], Javier Garcia-Serrano [aut], Neven Fuckar [aut], Louis-Philippe Caron [aut], Omar Bellprat [aut], Luis Rodrigues [aut], Veronica Torralba [aut], Alasdair Hunter [aut], Chloe Prodhomme [aut], Martin Menegoz [aut], Domingo Manubens [ctb], Constantin Ardilouze [ctb], Lauriane Batte [ctb], Fabian Lienert [ctb], Julia Giner [ctb], Jean-Philippe Baudouin [ctb], Nube Gonzalez [ctb], Ludovic Auger [ctb], Nicola Cortesi [ctb], Eleftheria Exarchou [ctb], Ruben Cruz [ctb], Isabel Andreu-Burillo [ctb], Ramiro Saurral [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.