| geom_step {ggplot2} | R Documentation |
Connect observations by stairs
geom_step(mapping=NULL, data=NULL, stat="identity", position="identity", direction="hv", ...)
mapping |
mapping between variables and aesthetics generated by aes |
data |
dataset used in this layer, if not specified uses plot dataset |
stat |
statistic used by this layer |
position |
position adjustment used by this layer |
direction |
direction of stairs: 'vh' for vertical then horizontal, or 'hv' for horizontal then vertical |
... |
other arguments |
Equivalent to plot(type='s').This page describes geom_step, see layer and qplot for how to create a complete plot from individual components.
A layer
The following aesthetics can be used with geom_step. Aesthetics are mapped to variables in the data with the aes function: geom\_step(\code{aes}(x = var))
colour: border colour
size: size
linetype: line type
alpha: transparency
Hadley Wickham, http://had.co.nz/
## Not run:
# Simple quantiles/ECDF from examples(plot)
x <- sort(rnorm(47))
qplot(seq_along(x), x, geom="step")
# Steps go horizontally, then vertically (default)
qplot(seq_along(x), x, geom="step", direction = "hv")
plot(x, type = "s")
# Steps go vertically, then horizontally
qplot(seq_along(x), x, geom="step", direction = "vh")
plot(x, type = "S")
# Also works with other aesthetics
df <- data.frame(
x = sort(rnorm(50)),
trt = sample(c("a", "b"), 50, rep = T)
)
qplot(seq_along(x), x, data = df, geom="step", colour = trt)
## End(Not run)