Divides the plane into regular hexagons, counts the number of cases in
each hexagon, and then (by default) maps the number of cases to the hexagon
fill. Hexagon bins avoid the visual artefacts sometimes generated by
the very regular alignment of
geom_hex(mapping = NULL, data = NULL, stat = "binhex", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE) stat_bin_hex(mapping = NULL, data = NULL, geom = "hex", position = "identity", ..., bins = 30, binwidth = NULL, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE)
Set of aesthetic mappings created by
The data to be displayed in this layer. There are three options:
Position adjustment, either as a string, or the result of a call to a position adjustment function.
Other arguments passed on to
logical. Should this layer be included in the legends?
Override the default connection between
numeric vector giving number of bins in both vertical and horizontal directions. Set to 30 by default.
Numeric vector giving bin width in both vertical and
horizontal directions. Overrides
geom_hex() understands the following aesthetics (required aesthetics are in bold):
Learn more about setting these aesthetics in
number of points in bin
density of points in bin, scaled to integrate to 1
count, scaled to maximum of 1
density, scaled to maximum of 1
stat_bin2d() for rectangular binning