geom_polygon: Polygon, a filled path.

Description Usage See Also Examples

Description

Polygon, a filled path.

Usage

1
  geom_polygon(aesthetics = list())

See Also

geom_path: an unfilled polygon

geom_ribbon: a polygon anchored on the x-axis

Examples

1
2
3
4
5
6
7
8
9
if (require(maps)) {
  ni <- data.frame(map("nz", "North.Island", plot = F)[c("x", "y")])
  si <- data.frame(map("nz", "South.Island", plot = F)[c("x", "y")])
  geom_plot(geom_polygon(), ni)
  geom_plot(geom_polygon(list(colour = "grey50", fill = NA)), si)

  nz <- rbind(data.frame(ni, group = 1), data.frame(si, group = 2))
  geom_plot(geom_polygon(), nz)
}

hadley/layers documentation built on May 17, 2019, 10:42 a.m.