Closed
Description
geom_hex
ignores the binwidth argument when there are only few data points:
library(ggplot2)
n = 1
ggplot(tibble(x=rnorm(n), y=rnorm(n))) +
geom_hex(aes(x=x, y=y), binwidth=c(.1,.1)) +
xlim(-3, 3) + ylim(-3,3)
For small values of n
(below 10) the bin widths are not 0.1. For larger n
(try 100), the problem goes away and the bin width is 0.1 as specified.