Skip to content
Prev 389062 / 398506 Next

combining geom_boxplot and geom_point with jitter

Hello,

The problem is that you have two grouping aesthetics, color and shape.
In geom_point make the group explicit:


p <- ggplot(my_data, aes(x = Diet, y = value, color = Software))
p <- p + geom_boxplot(outlier.shape = NA)

p + geom_point(
   mapping = aes(shape = NMP_cat, group = Software),
   position = position_jitterdodge()
)


Hope this helps,

Rui Barradas

?s 09:54 de 02/09/21, Ivan Calandra escreveu: