View source: R/function_PlotDurationCurve.R
PlotDurationCurve | R Documentation |
Convenience wrapper function for a (multiple) line plot
, with pretty defaults for axis annotation and a Gaussian scaling option for the x-axis.
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
)
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 |
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.
PlotDurationCurve
returns a plot to the currently active plot device.
ExtractFreq
# 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.