hadley/ggplot2 — comment on commit 42c1ed3f74a9acaa15a8d1058ded2217f2908ed5
File:  line 0
By kohske:

here is the example:

```R

df <- data.frame(expand.grid(x=1:3, y=1:4), z = rnorm(3*4))

p1 <- ggplot(df, aes(x, y, fill = z)) + geom_raster() +
geom_point(colour = "red") + opts(title = "default", legend.position = "none") + xlim(0, 4) + ylim(0, 5)

p2 <- ggplot(df, aes(x, y, fill = z)) + geom_raster(hpad = 0, vpad = 0) +
geom_point(colour = "red") + opts(title = "pad=0", legend.position = "none") + xlim(0, 4) + ylim(0, 5)

p3 <- ggplot(df, aes(x, y, fill = z)) + geom_raster(hpad = 0.5, vpad = 0.5) +
geom_point(colour = "red") + opts(title = "pad=0.5", legend.position = "none") + xlim(0, 4) + ylim(0, 5)

p4 <- ggplot(df, aes(x, y, fill = z)) + geom_raster(hpad = 1, vpad = 1) +
geom_point(colour = "red") + opts(title = "pad=1", legend.position = "none") + xlim(0, 4) + ylim(0, 5)
```

output here:
https://skitch.com/e-kohske/g57x6/geom-raster-more