27 Perception/Color Resources
This section has resources for learning about graphical perception and how to use colors effectively.
Here are some links to some key books/articles on perception:
- Graphical Perception: Theory, Experimentation, and Application to the Development of Graphical Methods: Classic article from William Cleveland and Robert McGill
- The Elements of Graphing Data: Textbook by William Cleveland
- Visualizing Data: Textbook by William Cleveland
- Creating More Effective Graphs: Textbook by Naomi Robbins
Color is very subjective. It is important to choose the right ones so that your work is easy to understand.
- Color Brewer: Excellent resource for getting effective color palettes for different projects. Its main focus is on cartography, but it is super useful for any project involving color. You can choose between different types of data (sequential, diverging, qualitative), ensure your chosen palette is effective for colorblind users (or print friendly or photocopy safe), and easily export the color palette to different formats (Adobe, GIMP/Inkscape, JS, CSS). The best go-to for effective color palettes.
- Color Oracle: Not sure how effective your project will be to a colorblind user? The Color Oracle tool can help. You can click to see how your screen would look to someone with various color vision deficiencies.
- ColorPick Eyedropper: This Chrome extension allows you to copy hex color values from webpages. Simple and intuitive, it will make creating your awesome color palettes a lot easier.
27.4 Quick tips on using color with
One of the most common problems is confusing
color, many of the other geoms use
fill. Some use both, such as
geom_tile() in which case
color is the border color and
fill is the fill color.
27.4.1 Continuous data
scale_color_distiller(palette = "PuBu")or
scale_fill_distiller(palette = "PuBu")
(What doesn’t work:
scale_color_brewer(palette = "PuBu"))
scale_fill...(the c stands for continuous)
Create your own
+ scale_color_gradient(low = "white", high = "red") or
+ scale_color_gradient2(low = "red", mid = "white", high = "blue", midpoint = 50) or
+ scale_color_gradientn(colours = c("red", "pink", "lightblue", "blue")) or
27.4.2 Discrete data
scale_color_brewer(palette = "PuBu")or
scale_fill...(the d stands for discrete)
Create your own
+ scale_color_manual(values = c("red", "yellow", "blue")) or
+ scale_fill_manual(values = c("red", "yellow", "blue")) or