hadley/ggplot2 — Issue #350: width/height support in geom-rastor 
Author: kohske
Created: 2012-01-06 05:16:00+00:00
State: open

Not sure if this is necessary, but will be useful.

```R
df1 <- data.frame(x = c(1, 1, 2, 2), y = c(1, 2, 1, 2), z = 1:4)
df2 <- data.frame(x = 1:3, y = 1, z = 1:3)
df3 <- data.frame(y = 1:3, x = 1, z = 1:3)
df4 <- data.frame(x = 1:3, y = 1:3, z = 1:3)

f <- function(d) {
p <- ggplot(d, aes(x, y, fill = z))
print(p + geom_tile(aes(width = 0.1, height = 0.1)) + opts(title = "tile") + geom_text(aes(label = z), colour = "white"))
print(p + geom_raster(aes(width = 0.1, height = 0.1)) + opts(title = "raster") + geom_text(aes(label = z), colour = "white"))
}

f(df1)
f(df2)
f(df3)
f(df4)
```