PlotDurationCurve {HYPEtools} | R Documentation |
Plot duration curves
Description
Convenience wrapper function for a (multiple) line plot
, with pretty defaults for axis annotation and a Gaussian scaling option for the x-axis.
Usage
PlotDurationCurve(
freq,
xscale = "lin",
yscale = "log",
add.legend = FALSE,
l.legend = NULL,
ylim = NULL,
xlab = "Flow exceedance percentile",
ylab = "m3s",
col = "blue",
lty = 1,
lwd = 1,
mar = c(3, 3, 1, 1) + 0.1
)
Arguments
freq |
Data frame with at least two columns, containing probabilities in the first and series of data quantiles in the remaining columns. Typically
an object as returned by |
xscale |
Character string, keyword for x-axis scaling. Either |
yscale |
Character string, keyword for y-axis scaling. Either |
add.legend |
Logical. If |
l.legend |
Character vector. If non-NULL, legend labels are read from here instead of from column names in |
ylim |
Numeric vector of length two, giving y-axis limits. |
xlab |
Character string, x-axis label. |
ylab |
Character or |
col |
Line color specification, see |
lty |
Line type specification, see |
lwd |
Line width specification, see |
mar |
Numeric vector of length 4, margin specification as in |
Details
PlotDurationCurve
plots a duration curve with pretty formatting defaults. The function sets par
parameters tcl
and mgp
internally and will override previously set values for the returned plot. It typically uses results from ExtractFreq
as input data and via that
function it can be used to visualize and compare time series properties.
Value
PlotDurationCurve
returns a plot to the currently active plot device.
See Also
Examples
# Import source data
te1 <- ReadBasinOutput(filename = system.file("demo_model", "results", "0003587.txt",
package = "HYPEtools"))
te2 <- ExtractFreq(te1[, c("COUT", "ROUT")])
# Plot flow duration curves for simulated and observed discharge
PlotDurationCurve(freq = te2, add.legend = TRUE, col = c("red", "blue"))