How can I color the outlier points in ggplot2? I want them to be the same color as the boxplot itself. colour=
is not enough to do this.
Example:
p <- ggplot(mtcars, aes(factor(cyl), mpg))
p + geom_boxplot(aes(colour=factor(cyl)))
I want to color the outliers by factor(cyl)
as well. This does not work:
> p <- ggplot(mtcars, aes(factor(cyl), mpg))
> p + geom_boxplot(aes(colour=factor(cyl), outlier.colour=factor(cyl)))
See Question&Answers more detail:os