How can I dodge the geom_points into their specific boxplot group (provided by the aesthetic colour)? I have provided the following (simplified) example:
library(ggplot2)
ggplot(diamonds, aes(x = cut, y = carat, color = color)) +
geom_boxplot(outlier.shape = NA) +
geom_point(aes(group = color))
Which provides the following plot:
Boxplot with points not in corresponding boxplot
I would like to have have the points aligned to the boxplot color (group) they belong to. How could I achieve this?
