Cindy Brewer: helping you choose better color scales for maps

December 5, 2014
By

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

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:

BrewerScale

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:

RColorBrewer

You can use the function brewer.pal to select one of these palettes with any number of colors with the function brewer.pal. (Sadly, it does not provide an option to create colorblindness-friendly palettes.) And if you're a ggplot2 user, you can use the scale_brewer option to use a ColorBrewer palette.

On the other hand, if you're 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)

To leave a comment for the author, please follow the link and comment on their blog: Revolutions.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)