geom_rect {ggplot2}R Documentation

geom_rect

Description

2d rectangles

Usage

geom_rect(mapping=NULL, data=NULL, stat="identity", position="identity", ...)

Arguments

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

Details

This page describes geom_rect, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Aesthetics

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))

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## 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)

[Package ggplot2 version 0.8.2 Index]