hydro_axis_trans: Hydrologic axis transforms for ggplot2

Description Usage Arguments Details Author(s) Examples

Description

Axis transforms for hydrologic plots in ggplot2.

Usage

1
flowBreaks(Q, labels = c(1, 2, 3, 5, 7), blankLines = TRUE)

Arguments

Q

values for flow to create scale along

labels

First digit of breaks to label. Defaults to 1,2,3,5,7 for log axes; 1,2,5 for probability axes. Multiples of these are assumed.

blankLines

(default true) tells flowBreaks to draw an additional set of 10 lines between each major tic mark.

maxLevel

smallest place to which breaks should be created for probability axes.

lines

which breaks should have lines for probability axes, must be superset of labels

invert

switch the direction of the probability axes

as.percent

Show labels by percent instead of probability

byPeriod

Show labels with return interval (1 / probability)

periodSuffix

String to concatenate to return interval. (default " yr")

distribution

change distribution for probability axis, defaults to normal. Untested with other distributions.

distArgs

arguments pasted to distribution specified in distribution

Details

hydro_prob_trans and hydro_prob_breaks for probability axes on frequency plots

hydro_flow_trans and hydro_flow_breaks for log axes with additional breaks between powers of ten.

Author(s)

Evan Heisman

Examples

1
2
3
4
5
ggplot(peaks, aes(y=PEAK_DAILY_FLOW, x=weibullProbs(PEAK_DAILY_FLOW))) + geom_point() +
  theme_bw(base_size=11) + theme(legend.position = "bottom", panel.grid.minor=element_blank()) +
  scale_y_continuous(trans=hydro_flow_trans()) +
  scale_x_continuous(trans=hydro_prob_trans(lines=c(1,2,5), labels=c(1,2,5), byPeriod=TRUE)) +
  stat_smooth(method="glm", family=gaussian(link="log"))

eheisman/hydroutils documentation built on May 16, 2019, 12:15 a.m.