A while ago, I asked How to change Lattice graphics default groups colors?, and got a helpful response from BenBarnes. This allowed me to define more than 7 cycling colors for different data in the same plot in R's Lattice package, which I did. However, I found that it's difficult to define more than 9, maybe 10 colors are not (a) hard to see on a white background, or (b) include pairs of colors that look very similar. (That might be why seven colors is Lattice's default, obviously.) It occurs to me, though, that there are people out there who are much better at managing colors in information display than I am, and that maybe someone had already defined a good list of 10, 12, maybe even 15 colors for display of data in the same plot. Anybody know of such a list? Any color specification that I can convert into a Lattice format would work. If it's already been done in Lattice, even better! (Is there a better place to ask this question??)
Asked
Active
Viewed 349 times
2
-
3There's a pretty cool website called iwanthue for finding "optimally distinct colors". Someone on SO pointed it out, but unfortunately I can't remember who. Here it is: http://tools.medialab.sciences-po.fr/iwanthue/ Finding 15 distinct enough colors will most likely be difficult, though. – BenBarnes Jun 01 '13 at 20:31
-
Why not make it an answer, @Ben Barnes? – Mars Jun 04 '13 at 03:15
-
1Decided against a full-fledged answer, since [there's no API for iWantHue](https://github.com/medialab/iwanthue/issues/5). But I did find the [SO post where I first saw mention of it](http://stackoverflow.com/a/15282690). – BenBarnes Jun 04 '13 at 07:47
2 Answers
4
There's a large body of work on choosing colors. Check out the RColorBrewer
and colorspace
packages as a starting point. In the documentation for colorspace
there is a link to an excellent paper (and the vignette summarizes much of the paper). And think about your color blind colleagues, with dichromat
.

Bryan Hanson
- 6,055
- 4
- 41
- 78
1
In general, I think it is very difficult to pick a large set of colors that don't end up being hard to distinguish from one another. When I am looking for a large number (>8) of colors that I want to be noticeably distinct and aesthetically pleasing, I usually use the rich.colors
palette in the gplots
package. I find it more useful than the similar rainbow
palette, because the colors don't wrap around on each other.

Escotch
- 131
- 1
- 7