I have been trying to get my outlier point colors to match the fill color of my boxes in a ggplot2 boxplot. I found the update_geom_defaults function and have used it but now the points match the default color scheme as shown in the plot image:

What I want is for the outlines of the boxes to match the fill colors and for the outlier points to also match the fill colors. So a green box will have green outliers, a blue box will have blue outliers etc.. I have attached an example dataset. Here is the code I am using:
update_geom_defaults("point", list(color = NULL))
ggplot(plotdata, aes(Locus, proportion, color = variable, fill = variable))+
geom_boxplot(width = 0.6)+
scale_fill_manual("Sample", values = c("green", "blue", "red"), labels = c("C", "S", "U"))+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = .5), plot.title = element_text(hjust = 0.5))
I also tried changing the update_geom_default to:
update_geom_defaults("point", list(color = c("green", "blue", "red")))
but this had no effect on the colors in the plot.
Note that in the end I do not need two legends for my plot so if there is also a way to not display the second legend I would like to know how to do that as well.
Thank you,
Angela
This message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and/or otherwise exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, any disclosure, dissemination, distribution, copying or other use of this communication or its substance is prohibited. If you have received this communication in error, please return to the sender and delete from your computer system.
ggplot(plotdata, aes(Locus, proportion, color = variable, fill = variable))+
geom_boxplot(width = 0.6)+
scale_colour_manual("Sample", values = c("green", "blue", "red"), labels = c("C", "S", "U")) +
scale_fill_manual("Sample", values = c("green", "blue", "red"), labels = c("C", "S", "U")) +
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = .5), plot.title = element_text(hjust = 0.5))
Best regards,
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thierry,
Thank you, your solution works.
Angela
From: Thierry Onkelinx [mailto:thierry....@inbo.be]
Sent: Friday, March 03, 2017 9:40 AM
To: Minard-Smith, Angela T <MINARD...@battelle.org>
Cc: ggp...@googlegroups.com
Subject: Re: Can outlier points be colored the same as box fill color?
Message received from outside the Battelle network. Carefully examine it before you open any links or attachments.
--
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.