# example with synthetic random data
dd <- seq.Date(as.Date("2010-10-01"), as.Date("2013-09-30"),by = 1)
x <- abs(rnorm(length(dd)))
y <- abs(rnorm(length(dd))) * x
df <- data.frame("Date" = dd, x, y)
myprd <- "2011-10-01/2012-09-30"
precip <- data.frame("Date" = dd," precip" = abs(rnorm(length(dd))) * 10)
# basic hydrograph plot
ch_hydrograph_plot(flows = df, winter_shading = FALSE)
# with different labels and winter shading
ch_hydrograph_plot(flows = df, winter_shading = TRUE,
flow_labels = c("simulated", "observed"))
# add precipitation, increase the plot ranges to separate flows and precip, and add a legend box
ch_hydrograph_plot(flows = df, precip = precip, range_mult_flow = 1.7,
range_mult_precip = 2, leg_box = TRUE)
Run the code above in your browser using DataLab