Examples for 'ggplot2::geom_hex'


Hexagonal heatmap of 2d bin counts

Aliases: geom_hex stat_bin_hex stat_binhex

Keywords:

### ** Examples

d <- ggplot(diamonds, aes(carat, price))
d + geom_hex()
plot of chunk example-ggplot2-geom_hex-1
## No test: 
# You can control the size of the bins by specifying the number of
# bins in each direction:
d + geom_hex(bins = 10)
plot of chunk example-ggplot2-geom_hex-1
d + geom_hex(bins = 30)
plot of chunk example-ggplot2-geom_hex-1
# Or by specifying the width of the bins
d + geom_hex(binwidth = c(1, 1000))
plot of chunk example-ggplot2-geom_hex-1
d + geom_hex(binwidth = c(.1, 500))
plot of chunk example-ggplot2-geom_hex-1
## End(No test)

[Package ggplot2 version 3.3.6 Index]