I am not sure this is the best way, but you can find what colors are used in a plot by ggplot_build().
For example, you can write such as:
p <- ggplot(data=Data, aes(x=x1, y=y1, color=group)) + geom_point()
layer.info <- ggplot_build(p)
layer.info$data[[1]]
colour x y PANEL group
1 #F8766D 1 0.6770207 1 1
2 #F8766D 2 0.2741748 1 1
3 #F8766D 3 -0.8573757 1 1
4 #F8766D 4 1.8533354 1 1
5 #00BA38 5 1.2952191 1 2
6 #00BA38 6 3.7527824 1 2
7 #00BA38 7 5.3196280 1 2
8 #00BA38 8 3.3043251 1 2
9 #619CFF 9 2.7967956 1 3
10 #619CFF 10 3.9842329 1 3
11 #619CFF 11 5.7358461 1 3
12 #619CFF 12 7.1017455 1 3
And you can find the hex color numbers (#F8766D for group 1, #00BA38 for group 2 #619CFF for group 3).
--Kaori
--
--
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.