ggdist
ggdist copied to clipboard
check on max bin count conditions for overflow = "compress"
in dot_heap and when overflow = "compress" --- pretty sure this check needs to be adjusted
The problem is that the overflow = "compress" adjustment doesn't take into account the effective max bin count as calculated in dot_heap(). The right solution might be to optionally return the relevant info from find_dotplot_binwidth() so this check can be done.
An example showing the problem:
data.frame(x = dist_normal(0,1)) |>
ggplot(aes(xdist = x)) +
stat_dots(quantiles = 250, overflow = "compress", alpha = 0.5, binwidth = 0.5) +
geom_hline(yintercept = 0.9)
(alternative is to accept that overflow = "compress" is really only designed for when dots get very small, where it already works well).