plot.OutputsModel: Default preview of model outputs

Description Usage Arguments Details Value Author(s) Examples

View source: R/plot.OutputsModel.R

Description

Function which creates a screen plot giving an overview of the model outputs.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'OutputsModel'
plot(x, Qobs = NULL, IndPeriod_Plot = NULL,
     BasinArea = NULL, which = "synth", log_scale = FALSE,
     cex.axis = 1, cex.lab = 0.9, cex.leg = 0.9, lwd = 1,
     LayoutMat = NULL,
     LayoutWidths = rep.int(1, ncol(LayoutMat)),
     LayoutHeights = rep.int(1, nrow(LayoutMat)),
     verbose = TRUE, ...)

Arguments

x

[object of class OutputsModel] list of model outputs (which must at least include DatesR, Precip and Qsim) [POSIXlt, mm/time step, mm/time step]

Qobs

(optional) [numeric] time series of observed flow (for the same time steps than simulated) [mm/time step]

IndPeriod_Plot

(optional) [numeric] indices of the time steps to be plotted (among the OutputsModel series)

BasinArea

(optional) [numeric] basin area [km2], used to plot flow axes in m3/s

which

(optional) [character] choice of plots
(e.g. c("Precip", "Temp", "SnowPack", "Flows", "Error", "Regime", "CumFreq", "CorQQ")), default = "synth", see details below

log_scale

(optional) [boolean] indicating if the flow and the error time series axis and the flow error time series axis are to be logarithmic, default = FALSE

cex.axis

(optional) [numeric] the magnification to be used for axis annotation relative to the current setting of cex

cex.lab

(optional) [numeric] the magnification to be used for x and y labels relative to the current setting of cex

cex.leg

(optional) [numeric] the magnification to be used for the legend labels relative to the current setting of cex

lwd

(optional) [numeric] the line width (a positive number)

LayoutMat

(optional) [numeric] a matrix object specifying the location of the next N figures on the output device. Each value in the matrix must be 0 or a positive integer. If N is the largest positive integer in the matrix, then the integers 1, ..., N-1 must also appear at least once in the matrix (see layout)

LayoutWidths

(optional) [numeric] a vector of values for the widths of columns on the device (see layout)

LayoutHeights

(optional) [numeric] a vector of values for the heights of rows on the device (see layout)

verbose

(optional) [boolean] indicating if the function is run in verbose mode or not, default = TRUE

...

(optional) other parameters to be passed through to plotting functions

Details

Different types of independent graphs are available (depending on the model, but always drawn in this order):

Different dashboards of results including various graphs are available:

If several dashboards are selected, or if an independent graph is called with a dashboard, the graphical device will include all the requested graphs without redundancy.

Value

Screen plot window.

Author(s)

Laurent Coron, Olivier Delaigue, Guillaume Thirel

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
44
45
46
47
### see examples of RunModel_GR4J or RunModel_CemaNeigeGR4J functions
### to understand how the example datasets have been prepared


## loading examples dataset for GR4J and GR4J + CemaNeige
data(exampleSimPlot)


### Qobs and outputs from GR4J and GR4J + CemaNeige models
str(simGR4J, max.level = 1)
str(simCNGR4J, max.level = 1)


### default dashboard (which = "synth")

## GR models whithout CemaNeige
plot(simGR4J$OutputsModel, Qobs = simGR4J$Qobs)

## GR models whith CemaNeige ("Temp" and "SnowPack" added)
plot(simCNGR4J$OutputsModel, Qobs = simCNGR4J$Qobs)


### "Error" and "CorQQ" plots cannot be display whithout Qobs
plot(simGR4J$OutputsModel, which = "all", Qobs = simGR4J$Qobs)
plot(simGR4J$OutputsModel, which = "all", Qobs = NULL)


### complex plot arrangements
plot(simGR4J$OutputsModel, Qobs = simGR4J$Qobs,
     which = c("Flows", "Regime", "CumFreq", "CorQQ"),
     LayoutMat = matrix(c(1, 2, 3, 1, 4, 4), ncol = 2),
     LayoutWidths  = c(1.5, 1),
     LayoutHeights = c(0.5, 1, 1))


### add a main title

## the whole list of settable par's
opar <- par(no.readonly = TRUE)

## define outer margins and a title inside it
par(oma = c(0, 0, 3, 0))
plot(simGR4J$OutputsModel, Qobs = simGR4J$Qobs)
title(main = "GR4J outputs", outer = TRUE, line = 1.2, cex.main = 1.4)

## reset original par
par(opar)

Example output

List of 2
 $ OutputsModel:List of 20
  ..- attr(*, "class")= chr [1:3] "OutputsModel" "daily" "GR"
 $ Qobs        : num [1:3652] 1.99 1.8 2.86 2.4 3.31 ...
List of 2
 $ OutputsModel:List of 21
  ..- attr(*, "class")= chr [1:4] "OutputsModel" "daily" "GR" "CemaNeige"
 $ Qobs        : num [1:3652] 1.01 0.954 1.051 1.172 1.293 ...
Warning message:
In plot.OutputsModel(simGR4J$OutputsModel, which = "all", Qobs = NULL) :
  the 'Error' and 'CorQQ' plot(s) cannot be drawn if there is no 'Qobs'

airGR documentation built on April 27, 2021, 9:07 a.m.