geom_tile: Tile geom.

Description Usage See Also Examples

Description

Rectangular geom parameterised by location of center (x and y) and size (width, height).

Usage

1
  geom_tile(aesthetics = list(), na.rm = FALSE)

See Also

Other rectangular.geoms: geom_bar, geom_raster, geom_rect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
pp <- function (n,r=4) {
 x <- seq(-r*pi, r*pi, len=n)
 df <- expand.grid(x=x, y=x)
 df$r <- sqrt(df$x^2 + df$y^2)
 df$z <- cos(df$r^2)*exp(-df$r/6)
 df
}
pp20 <- pp(20)
geom_plot(geom_tile(), pp20)
if (require("scales")) {
  pp20$fill <- cscale(pp20$z, seq_gradient_pal())
}
geom_plot(geom_tile(), pp20)
geom_plot(geom_tile(list(width = 0.95, height = 0.95)), pp20)

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