You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example below, the computation goes wrong because in the y-direction we don't have any width.
library(ggplot2)
df<-data.frame(x=1:5, y=1)
ggplot(df, aes(x, y)) +
geom_bin_2d()
#> Warning: Computation failed in `stat_bin2d()`.#> Caused by error in `bin2d_breaks()` at ggplot2/R/stat-bin2d.R:64:5:#> ! `origin` must be a number, not `NaN`.
library(ggplot2)
df<-data.frame(x=1:5, y=1, z=5)
ggplot(df, aes(x, y, z=z)) +
stat_summary_2d()
#> Warning: Computation failed in `stat_summary2d()`.#> Caused by error in `bin2d_breaks()` at ggplot2/R/stat-summary-2d.R:104:5:#> ! `origin` must be a number, not `NaN`.
Activity
teunbrand commentedon Nov 28, 2024
Seems to apply more broadly to any 2D binning:
Created on 2024-11-28 with reprex v2.1.1