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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…