Learn R Programming

hydroGOF (version 0.2-2)

plotbandsonly: Adds uncertainty bounds to an existing plot.

Description

Adds a polygon representing uncertainty bounds to an existing plot.

Usage

plotbandsonly(lband, uband, dates, date.fmt="%Y-%m-%d",
          legend="95PPU", leg.cex=1,
          bands.col="lightblue", border= NA, ...)

Arguments

lband
ts or zoo object with the values of the lower band.
uband
ts or zoo object with the values of the upper band.
dates
OPTIONAL. Date, factor, or character object indicating the dates that will be assigned to lband and uband. If dates is a factor or character vector, its values are converted to dates using the date format specified
date.fmt
OPTIONAL. Character indicating the format of dates. See format in as.Date.
legend
OPTIONAL. logical or character vector of length 3 with the strings that will be used for the legend of the plot. -) When legend is a character vector, the first element is used for labelling the observed series, the second for labelling the
leg.cex
OPTIONAL. numeric. Used for the GoF legend. Character expansion factor *relative* to current 'par("cex")'. Used for text, and provides the default for 'pt.cex' and 'title.cex'. Default value is 1.
bands.col
See polygon. Color to be used for filling the area between the lower and upper uncertainty bound.
border
See polygon. The color to draw the border. The default, 'NULL', means to use 'par("fg")'. Use 'border = NA' to omit borders.
...
further arguments passed to the code{polygon} function for plotting the bands, or from other methods

See Also

pfactor, rfactor

Examples

Run this code
# Loading daily streamflows of the Ega River (Spain), from 1961 to 1970
require(zoo)
data(EgaEnEstellaQts)
obs <- EgaEnEstellaQts

# Selecting only the daily values belonging to the year 1961
obs <- window(obs, end=as.Date("1961-12-31"))

# Generating the lower and upper uncertainty bounds
lband <- obs - 5
uband <- obs + 5

plot(obs, type="n")
plotbandsonly(lband, uband)
points(obs, col="blue", cex=0.6, type="o")

Run the code above in your browser using DataLab