plot.Renouv {Renext} | R Documentation |
Plot an object of class "Renouv"
Description
Plot an object of class "Renouv". The plot is a return level plot with some supplementary elements to display historical data.
Usage
## S3 method for class 'Renouv'
plot(x,
pct.conf = x$pct.conf,
show = list(OT = TRUE, quant = TRUE, conf = TRUE,
MAX = TRUE, OTS = TRUE),
mono = TRUE,
predict = FALSE,
par = NULL,
legend = TRUE,
label = NULL,
problim = NULL,
Tlim = NULL,
main = NULL, xlab = "periods", ylab = "level",
posOptions = NULL,
byBlockStyle = NULL,
...)
## S3 method for class 'Renouv'
lines(x,
pct.conf = x$pct.conf,
show = NULL,
mono = TRUE,
predict = FALSE,
par = NULL,
legend = FALSE,
label = NULL,
posOptions = NULL,
byBlockStyle = NULL,
...)
Arguments
x |
Object of class |
pct.conf |
Percents for confidence limits (lower and
upper). These levels should be found within those computed in the
object |
show |
A list with named elements specifying which parts of the
return level plot must be drawn. Element |
mono |
Logical, |
predict |
Logical. When |
par |
A list such as returned by the |
legend |
Logical. If |
label |
A character label used to build the labels used in the legend. The
default is to use the name of the |
problim |
Limits for the x-axis in probability scale. Can be used as an
alternative to |
Tlim |
Limits for the x-axis in return period scale. The values are given
as a numeric vector of length 2, containing values |
xlab |
Label of the x-axis (time periods, with log scale). |
main |
Main title (character). |
ylab |
Label of the y-axis (labels). |
posOptions |
A pair list to be passed as list of formals to the |
byBlockStyle |
Logical list (or named logical vector) with elements |
... |
Other arguments passed to the default |
Details
Historical data blocks (MAX or OTS) embedded in the x
object (if any)
can be plotted or not depending on the value of the corresponding
element in show
.
-
If the
MAX
element isTRUE
and ifx
embeds historical data of typeMAX
, then these will be shown with a symbol differing from the one for ordinary points. -
If
OTS
element isTRUE
and isx
embeds historical data of typeOTS
, then these will be shown with a symbol differing from the one for ordinary points. An exception is when one or several OTS block have no data. Then each such block is shown as an horizontal segment; its right end-point shows the effective duration of the block and the ordinate shows the OTS threshold for this block. No data exceeded the threshold within the block.
This function acts on a list variable named .RLlegend
and
stored in a special environment bound to the package. This variable is
used to build legends for plots produced with multiple commands. See
the RLlegend
help page.
Examples of possible combined uses of the argument of the plot
and lines
together with the RLlegend*
functions
are given in the "Renext Graphics" chapter of the Renext
Guide document shipped with this package.
Value
No value returned.
Caution
Remind that the methods plot
and lines
may change the
value of the variable .RLlegend
in the environment
legendEnvir
. This variable describes the material to be used in
the legend at the next call of RLlegend.show
.
Note
The return level plot is of exponential type i.e. uses a log-scale for return periods. This contrasts with the Gumbel plot which is also used in similar contexts.
Author(s)
Yves Deville
See Also
The RLlegend
page for the legend construction and
RLpar
to specify the graphical parameters (colors, line
types, ...) of the elements.
Examples
## two fits for the Garonne data
fit.exp <- Renouv(x = Garonne, plot = FALSE)
fit.gpd <- Renouv(x = Garonne, distname.y = "gpd", plot = FALSE)
## simple plot (legend is TRUE here)
plot(fit.exp,
main = "Two fits overlapped",
label = "",
## Tlim = c(1, 5000),
predict = TRUE)
## Now try 'lines' and RLlegend.xxx functions
plot(fit.exp,
main = "Fancy legend",
show = list(OT = FALSE, quant = FALSE, conf = FALSE,
OTS = FALSE, MAX = FALSE),
legend = FALSE,
Tlim = c(1, 5000))
RLlegend.ini(x = "bottomright", bg = "lightyellow") ## initialise legend
lines(fit.exp,
show = list(quant = FALSE, conf = FALSE, OT = TRUE, MAX = TRUE),
label = "expon",
par = RLpar(quant.col = "orange",
OT.pch = 21, OT.cex = 1.2, OT.col = "SeaGreen", OT.bg = "yellow",
MAX.block1.col = "purple", MAX.block1.bg = "mistyrose",
MAX.block1.lwd = 1.4))
lines(fit.gpd,
pct.conf = c(95, 70),
show = list(quant = TRUE, conf = TRUE),
label = "GPD",
par = RLpar(quant.col = "darkcyan", conf.conf1.col = "red"))
RLlegend.show() ## now draw legend