library(ggplot2)
p <- ggplot(diamonds, aes(carat, price))
p <- p + geom_bin2d(binwidth = c(0.25, 500))
print(p)
p <- ggplot(diamonds, aes(carat, price))
p <- p + geom_density2d()
print(p)
p <- ggplot(diamonds, aes(carat, price))
p <- p + geom_hex()
print(p)
## Warning: Computation failed in `stat_binhex()`:
## Package `hexbin` required for `stat_binhex`.
## Please install and try again.