PlotAnnualRegime {HYPEtools} | R Documentation |
Plot annual regimes
Description
Convenience wrapper function for a combined line plot
with polygon
variation ranges.
Usage
PlotAnnualRegime(
x,
line = c("mean", "median"),
band = c("none", "p05p95", "p25p75", "minmax"),
add.legend = FALSE,
l.legend = NULL,
l.position = c("topright", "bottomright", "right", "topleft", "left", "bottomleft"),
log = FALSE,
ylim = NULL,
ylab = expression(paste("Q (m"^3, " s"^{
-1
}, ")")),
xlab = paste(format(attr(x, "period"), format = "%Y"), collapse = " to "),
col = "blue",
alpha = 30,
lty = 1,
lwd = 1,
mar = c(3, 3, 1, 1) + 0.1,
verbose = TRUE
)
Arguments
x |
List, typically a result from |
line |
Character string, keyword for type of average line to plot. Either |
band |
Character vector, keyword for variation bands. If |
add.legend |
Logical. If |
l.legend |
Character vector. If non-NULL, legend labels are read from here instead of from column names in |
l.position |
Legend position, keyword string. One of |
log |
Logical, if |
ylim |
Numeric vector of length two, giving y-axis limits. Defaults to min-max range of all plotted data. |
ylab |
Character or |
xlab |
Character string or |
col |
Line color specification, see |
alpha |
Numeric, alpha transparency value for variation bands. Value between |
lty |
Line type specification, see |
lwd |
Line width specification, see |
mar |
Numeric vector of length 4, margin specification as in |
verbose |
Logical, print warnings if |
Details
PlotAnnualRegime
plots contents from lists as returned by AnnualRegime
(for format details, see there). If
NA
values are present in the plot data, the function will throw a warning if verbose = TRUE
and proceed with plotting
all available data.
Argument band
allows to plot variation bands to be plotted in addition to average lines. These can be (combinations of) ranges
between minima and maxima, 5th and 95th percentiles, and 25th and 75th percentiles, i.e. all moments available in AnnualRegime
results.
Grid lines plotted in the background are mid-month lines.
Value
PlotAnnualRegime
returns a plot to the currently active plot device.
See Also
AnnualRegime
, PlotSimObsRegime
Examples
## Not run:
# Source data, HYPE basin output with a number of result variables
te1 <- ReadBasinOutput(filename = system.file("demo_model",
"results", "0003587.txt",
package = "HYPEtools"))
# Daily discharge regime, computed and observed,
# hydrological year from October, aggregated to weekly means
te2 <- AnnualRegime(te1[, c("DATE", "COUT", "ROUT")],
ts.in = "day",
ts.out = "week", start.mon = 10)
# Screen devices should not be used in examples
PlotAnnualRegime(x = te2)
PlotAnnualRegime(x = te2, line = "median", band = "p05p95",
add.legend = TRUE, col = c("red", "blue"))
## End(Not run)