SailoR.Plot: Sailor Diagram

Description Usage Arguments Value See Also Examples

View source: R/SailoR.Plot.R

Description

This function generates the Sailor diagram. It calls SailoR.Indices() internally.

Usage

1
2
3
4
5
6
SailoR.Plot(ref, mod, ColourList = NULL, sfactor = 1, docenter = FALSE, 
xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, 
plotmain = NULL, plotlegend = TRUE, plotRMSElegend = TRUE, 
plotscalelegend=TRUE, Ensembles = FALSE, RMSE_legend_units = "", 
RMSE_legend_Rounding = 2, referenceName = NULL,
linestype = NULL, bias_pch = NULL)

Arguments

ref

a data frame with the reference observations. It should have 3 columns: name, zonal component and meridional component.

mod

a data frame with the model data. It should have 3 columns: name, zonal component and meridional component. More than one model can be included by using different names.

ColourList

a vector with all the colors you want to use for plotting the models. Darkgray will always be used for reference data. If NULL, the default colours are used: c("gray40", "red", "blue", "darkolivegreen3", "orange", "seagreen3", "gold", "purple", "pink").

sfactor

a value with the scale factor to be applied to the ellipses of each model.

docenter

if all the ellipses should be plotted over the reference one, this argument should be TRUE.

xlim

X axis limit for the plot.

ylim

Y axis limit for the plot.

xlab

a title for the X axis.

ylab

a title for the Y axis.

plotmain

an overall title for the plot.

plotlegend

if a default legend should be added to the plot, this argument should be TRUE.

plotRMSElegend

if a legend with a summary of the RMSE values should be added to the plot, this argument should be TRUE.

plotscalelegend

if a legend with the scaled factor should be added to the plot, this argument should be TRUE.

Ensembles

if Ensembles is set to TRUE, M different models included in the data frame mod will be taken as a single model and the reference model is repeated M times for the calculation of the Sailor diagram.

RMSE_legend_units

units to be written in the RMSE legend.

RMSE_legend_Rounding

number of decimals to be kept in the RMSE legend.

referenceName

external name provided for the reference dataset for the legend.

linestype

a vector with the lines types for the model data. The "dashed" option is reserved for the reference. The other options are "solid", "dotted", "dotdash", "longdash" or "twodash".

bias_pch

a vector with the pch types for the bias symbol. The default opcion provides a circle when docenter is TRUE and a point when it is FALSE.

Value

The result is a plot object.

See Also

SailoR.Indices

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#--------------------------------------------------------
# Example 1: Figure 6 (right) from Sáenz et al. (2020)
#--------------------------------------------------------

# Load the Vertically Integrated Water Vapor Transport Data included in the package
data(WRF)

# Parameters
Uxlim=c(60,110)
Uylim=c(0,50)
Uxlab<-"Qx (kg/m/s)"
Uylab<-"Qy (kg/m/s)"
plotmain<-"Water vapour transport"
sfactor<-0.1
ref<-WRF[["ref"]][,c("mod","U","V")]
mod<-WRF[["mod"]][,c("mod","U","V")]

isBad=((is.na(ref$U)) |(is.na(ref$V)))
isOK=(!isBad)
ref<-ref[isOK,]

nmod1<-which(mod$mod=="WrfN")
mod1<-mod[nmod1,][isOK,]
nmod2<-which(mod$mod=="WrfD")
mod2<-mod[nmod2,][isOK,]
nmod3<-which(mod$mod=="ERAI")
mod3<-mod[nmod3,][isOK,]

mod<-rbind(mod1,mod2,mod3)

# Index
sIWRF=SailoR.Indices(ref,mod)

# Index table
sIWRF.table<-SailoR.Table(sIWRF)

# Plot
SailoR.Plot(ref,mod,ColourList=NULL,sfactor,docenter=TRUE,
            Uxlim, Uylim, Uxlab, Uylab, plotmain, plotlegend=TRUE,
            plotRMSElegend=TRUE, RMSE_legend_Rounding=0,
            RMSE_legend_units=" kg/m/s", referenceName="Sounding",
            ,linestype=c("solid", "dotted", "twodash"))
  

SailoR documentation built on Oct. 23, 2020, 7:46 p.m.