-
Notifications
You must be signed in to change notification settings - Fork 2k
/
geom_step.rd
53 lines (50 loc) · 1.83 KB
/
geom_step.rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
\name{geom_step}
\alias{geom_step}
\alias{GeomStep}
\title{geom\_step}
\description{Connect observations by stairs}
\details{
Equivalent to plot(type='s').This page describes geom\_step, see \code{\link{layer}} and \code{\link{qplot}} for how to create a complete plot from individual components.
}
\section{Aesthetics}{
The following aesthetics can be used with geom\_step. Aesthetics are mapped to variables in the data with the aes function: \code{geom\_step(aes(x = var))}
\itemize{
\item \code{colour}: border colour
\item \code{size}: size
\item \code{linetype}: line type
\item \code{alpha}: transparency
}
}
\usage{geom_step(mapping = NULL, data = NULL, stat = "identity", position = "identity",
direction = "hv", ...)}
\arguments{
\item{mapping}{mapping between variables and aesthetics generated by aes}
\item{data}{dataset used in this layer, if not specified uses plot dataset}
\item{stat}{statistic used by this layer}
\item{position}{position adjustment used by this layer}
\item{direction}{direction of stairs: 'vh' for vertical then horizontal, or 'hv' for horizontal then vertical}
\item{...}{other arguments}
}
\seealso{\itemize{
\item \url{http://had.co.nz/ggplot2/geom_step.html}
}}
\value{A \code{\link{layer}}}
\examples{\dontrun{
# 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)
}}
\author{Hadley Wickham, \url{http://had.co.nz/}}
\keyword{hplot}