Color in visualizations
1. Color in visualizations
In this chapter, we'll discuss one of the more powerful and also dangerous tools in data visualization: color.2. How color is used
Color is used everywhere in data visualization. You'd be hard pressed to find a visualization that doesn't use it in some form. From differentiating classes in voting maps to continuous values in heatmaps; color seeps into most visualizations. Not all is rosy with color, however. There are lots of things we need to be careful with if we want to use color properly.3. Color can be beautiful
Let's start with the good. Color can take a drab data visualization and turn it into an eye-catching and interesting presentation. One can only look at so many black and white line charts before they start going crazy. A good visualization practitioner will use color to help engage the user and keep them interested in whatever data they are showing.4. Color can be polarizing
There are lots of instances where colors can evoke a response due to context. For instance, in the US red is usually used to distinguish the Republican political party, and blue the Democratic party. Because of this, the use of these colors can be fraught with tension. It's usually a good idea to avoid plain red and blue as the sole two colors in a visualization if comparing two groups, especially if your audience is from the United States.5. Color preferences can vary
Research by Katharina Reinecke and Krzysztof Gajos found a wealth of different preferences in terms of type and quantity of color around the world. Differences existed across ages, genders, countries, and socioeconomic status. For instance, people from Norway liked stark white aesthetics, whereas people from Chile liked vibrant colors. These are all things you should keep in mind when building your visualization. Ultimately there is no one good color palette or style. The context of the visualization and its audience will always have a different optimum.6. Color can be misleading...
Color can also play tricks on our perception. In a classic 1926 paper, researchers from the University of Wisconsin painted a bunch of identically sized cartons of different colors and asked people to rank them in terms of size. Their results showed that "It is evident that the color-size illusion is present in a marked degree [no matter what] arrangement." Much like the concept of "slimming" black shirts, the use of different colors can potentially affect the way people see your data, so be very careful and avoid using color when paired with size or length if possible.7. A remedy for the color-size illusion
One quick and easy way of helping mitigate these effects of color is to place standard-colored borders around shapes in your visualization to give the reader a non-colored visual anchor.8. Another solution
Another, perhaps easier and more aesthetically pleasing solution would be to change the default settings of Seaborn that makes every bar a different color and make all the bars the same color. Here we switch the color of all the bars to a constant 'cadetblue'. Now the plot looks flatter but is much easier on the eyes than the rainbow we were giving the reader before.9. Let's paint some data!
Enough of me spouting research results at you. Let's implement some color best practices in the exercises.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.