Let's say I have the following data frame:
library(ggplot2) set.seed(101) n=10 df<- data.frame(delta=rep(rep(c(0.1,0.2,0.3),each=3),n), metric=rep(rep(c('P','R','C'),3),n),value=rnorm(9*n, 0.0, 1.0))
My goal is to make boxplot a few factors:
p<- ggplot(data = df, aes(x = factor(delta), y = value)) + geom_boxplot(aes(fill=factor(metric)))
Output:

So far so good, but if I do this:
p+ geom_point(aes(color = factor(metric)))
I get:

I do not know what he is doing. My goal is to colorize the emissions, as is done here . Note that this solution changes the inner color of the boxes to white and sets the border to different colors. I want to keep the same color in the boxes, while having outliers that inherit these colors. I want to know how to make outliers with the same colors from the respective boxes.
source share