library(ggplot2)
d <- ggplot(diamonds, aes(carat, price, linewidth = after_stat(count))) +
scale_linewidth(trans = "log10")
d + geom_hex(colour = "black")
# key glyphs can be specified by their name
d + geom_hex(colour = "black", key_glyph = "hextile")
# key glyphs can be specified via their drawing function
d + geom_hex(colour = "black", key_glyph = draw_key_hextile)
Run the code above in your browser using DataLab