Closed
Description
Hi,
I noticed the following behavior in geom_violin
when there are fewer than three data points in a given violin. In this scenario, one of the violins gets dropped without a warning.
library(ggplot2)
table(mtcars$cyl, mtcars$am)
#>
#> 0 1
#> 4 3 8
#> 6 4 3
#> 8 12 2
ggplot(mtcars, aes(x = factor(cyl), y = mpg)) +
geom_violin(scale = "width", aes(fill = factor(am)))
Created on 2020-07-01 by the reprex package (v0.3.0)
It seems a related issue was addressed in stat_density
in #2142 . I would propose that stat_ydensity
be updated similarly here
Line 74 in cb0cfd2
Metadata
Metadata
Assignees
Labels
No labels