The choice of colors you use in a statistical graphic isn't just about making your chart look good: the colors you choose are often critical to interpretation. For example, you wouldn't want to use a scale like this to represent, say, average income on a map:
That palette would be suitable for qualitative data without implicit ordering (say, political parties), but for a continuous variable the viewer has no reason to assume that "pink" should be more than "orange". Even when choosing a continuous scale, the colors you use may have cultural meanings (imagine a map of temperatures with "hot" represented by blue shades and "cold" represented by red). Still, bad color choices happen all the time.
One person who has done more than most to promote good practices in color use is the cartographer Cindy Brewer, who was recently the subject of a feature article in Wired. Her ColorBrewer2 website helps you choose the appropriate color scale for you map depending on your data type: qualitative, sequential or diverging (with a neutral color between two extremes). It can even give you colorblind-safe and print-friendly options.
For R users, RColorBrewer package make it easy to use such palettes in R charts. After loading the package, you can see the palettes you have to choose from with the display.brewer.all() function:
(Update Dec 8: display.brewer.all now has an option to display colorblindness-friendly palettes.) You can use the function brewer.pal to select one of these palettes with any number of colors with the function brewer.pal. And if you're a ggplot2 user, you can use the scale_brewer option to use a ColorBrewer palette.
On the other hand, if your chart is more whimsical than scientific, there's always the Wes Anderson palettes.
Wired: The Cartographer Who’s Transforming Map Design (via Trevor A. Branch)
Some of the palettes in fact are colourblind friendly. Cindy Brewer's website has the information. I will think of a way of adding the information to the package.
Posted by: Erich Neuwirth | December 06, 2014 at 00:33
Color graphs may be reproduced on black and white copiers. Do the colorblind colors work for those situations?
Posted by: dolllar | December 08, 2014 at 13:01