geom_step(mapping = NULL, data = NULL, stat = "identity",
position = "identity", direction = "hv", ...)
aes
or aes_string
. Only needs to be set
at the layer level if you are overriding the plot defaults.# 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 = TRUE) ) qplot(seq_along(x), x, data = df, geom="step", colour = trt)