geom_rect {ggplot2} | R Documentation |
2d rectangles
geom_rect(mapping=NULL, data=NULL, stat="identity", position="identity", ...)
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 |
... |
ignored |
This page describes geom_rect, see layer
and qplot
for how to create a complete plot from individual components.
A layer
The following aesthetics can be used with geom_rect. Aesthetics are mapped to variables in the data with the aes
function: geom\_rect(\code{aes}(x = var))
xmin
: NULL (required)
xmax
: NULL (required)
ymin
: minimum of interval (required)
ymax
: maximum of interval (required)
colour
: border colour
fill
: internal colour
size
: size
linetype
: line type
Hadley Wickham, http://had.co.nz/
## Not run: df <- data.frame( x = sample(10, 20, replace = TRUE), y = sample(10, 20, replace = TRUE) ) ggplot(df, aes(xmin = x, xmax = x + 1, ymin = y, ymax = y + 2)) + geom_rect() ## End(Not run)