Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

outlier.colour in geom_boxplot #146

Closed
ThierryO opened this Issue Oct 29, 2010 · 5 comments

Comments

Projects
None yet
5 participants

outlier.colour from geom_boxplot() does not work with mapping

library(ggplot2)
dataset <- expand.grid(x = factor(c("A", "B")), y = c(rep(1, 50), 10), z = factor(c("C", "D")))
dataset$y <- rnorm(nrow(dataset), mean = with(dataset, y * as.numeric(x)), sd = as.numeric(dataset$z))
ggplot(dataset, aes(x = x, y = y, colour = z)) + geom_boxplot()
ggplot(dataset, aes(x = x, y = y, colour = z)) + geom_boxplot(outlier.colour = "red")
ggplot(dataset, aes(x = x, y = y, colour = z)) + geom_boxplot(aes(outlier.colour = z))
Owner

hadley commented Dec 2, 2011

I'd suggest that when outlier.colour = NULL it defaults to the same colour as the boxes.

alyst commented Feb 8, 2012

I also have come across the issue of colouring the outliers according to aesthetics.
I was able to figure out that it could be done with outlier.colour = NULL only by looking at the source code.

If not supporting outlier.* in the aesthetics, it would be nice to have the current behaviour be documented in geom_boxplot() help.
Also, maybe NULL should be the default value for outlier.* params?
The minor note: unlike colour/color, the outlier.color does not work.

Owner

hadley commented Feb 24, 2014

That sounds like a great feature, but unfortunately we don't currently have the development bandwidth to support it. If you'd like to submit a pull request that implements this feature, please follow the instructions in the development vignette.

@hadley hadley closed this Feb 24, 2014

catli commented Dec 18, 2014

Not sure if this has been updated but ggplot(dataset, aes(x = x, y = y, colour = z)) + geom_boxplot(aes(outlier.colour = NULL)) no longer updates the outlier colours.

sthelen commented Jan 23, 2015

This ticket is confusing. There are answers on stack exchange, such as http://stackoverflow.com/a/16035956, that suggest this feature has been available in the past. But at least in the current 1.0.0 version it does not work for me, and hadley's comment above indicates that no work has been done on this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment