Learn R Programming

xkcd (version 0.0.3)

xkcdrect: Plots rectangles

Description

This function plots rectangles.

Usage

xkcdrect(mapping, data,...)

Arguments

mapping
Mapping between variables and aesthetics generated by aes. See Details.
data
Dataset used in this layer.
...
Optional arguments.

Value

  • A layer with the rectangles.

Details

It plots rectangles. The following aesthetics are required:
  1. xmin
  2. ymin
  3. xmax
  4. ymax
Additionally, you can use the aesthetics of geom_rect, geom_path, and pointssegment.

See Also

geom_rect

Examples

Run this code
volunteers <- data.frame(year=c(2007:2011),
                         number=c(56470, 56998,59686, 61783, 64251))
p <- ggplot() + xkcdrect(aes(xmin = year,
                             xmax= year +0.3,
                             ymin=number,
                             ymax = number + 3600),
                         volunteers,
                         fill="red", colour="black")
p

Run the code above in your browser using DataLab