I've tried various combination of options without success. I would like to:
1) change the fill-color of the means rectangles to be white
2) position each mean (rectangle) at the centre of its own boxplot
3) increase the horizontal space between the 4 groups (not between individual box) of boxplots
boxp <- ggplot(df[df$QG=="INV",], aes(qID, Val, fill=Cond)) +
geom_boxplot(outlier.color = NA) +
stat_summary(fun.y=mean, geom="point", shape=23, size=2, colour = "black") +
labs(x = "Questions", y="Values", title = "Question subgroup", colour = "Conditions")
boxp
reproducible example with mtcars
boxp <- ggplot(mtcars, aes(gear, disp, fill=vs)) +
geom_boxplot(outlier.color = NA) +
stat_summary(fun.y=mean, geom="point", shape=23, size=2, colour = "black") +
labs(x = "Questions", y="Values", title = "Question subgroup", colour = "Conditions")
boxp
mtcars <- mutate_at(mtcars, c("carb", "gear", "vs"), as.factor)