overlapping boxes with geom_boxplot(varwidth=TRUE) #2143
When I try to produce boxplots with colours depending on a categorical variable, these appear overlapping if varwidth is set to TRUE (which is what I'd like to use).
Here's an example:
ggplot(data=iris, aes(Species, Sepal.Length)) + geom_boxplot(aes(colour=Sepal.Width < 3.2), varwidth=TRUE)
This raises the following warning: "position_dodge requires non-overlapping x intervals"
However, the boxes don't overlap (and no warning is raised) if varwidth is not specified.
ggplot(data=iris, aes(Species, Sepal.Length)) + geom_boxplot(aes(colour=Sepal.Width < 3.2))
The text was updated successfully, but these errors were encountered:
The main problem is here — within each species the variable-width boxes have different
I think this line will also be a problem because only the width of the first box will be used.