continues coloring

8 views
Skip to first unread message

J H

unread,
Mar 5, 2014, 8:36:18 PM3/5/14
to ggplot2
I have data for 2 groups (A & B) and currently I am forcing the boxplots to color as follows below.  I have 2 specific questions:

1. What can I do to force one group to be always the same color
2. If I get more than 2 groups lets say 4, how can I make it so that it repeats?

scale_fill_manual(values=c("dodgerblue", "pink1"))



Roman Luštrik

unread,
Mar 6, 2014, 1:59:49 AM3/6/14
to J H, ggplot2
What do you mean by "repeat"? You mean so that two and two groups have the same color? Each color in the `values` argument corresponds to (ordered) factor levels in your grouping variable.

Cheers,
Roman


--
--
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+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.
For more options, visit https://groups.google.com/groups/opt_out.



--
In God we trust, all others bring data.
Reply all
Reply to author
Forward
0 new messages