How to Choose Colors for Your Data Visualizations

Michael Yi
Nightingale
Published in
10 min readOct 24, 2019

Color is a major factor in creating effective charts. A good set of colors will highlight the story you want the data to tell, while a poor one will hide or distract from a visualization’s purpose.

In this article, I’ll describe the types of color palette that are used in data visualization, provide some general tips and best practices when working with color, and highlight a few tools to generate and test color palettes for your own charts.

Types of color palette

Three major types of color palette exist for data visualization:

  • Qualitative palettes
  • Sequential palettes
  • Diverging palettes

The type of color palette that you should use in a visualization depends on the nature of the data mapped to color.

Qualitative palette

Qualitative colors are used to identify election candidates in this line chart of support over time.

A qualitative palette is used when the variable is categorical in nature. Categorical variables are those that take on distinct labels without inherent ordering. Examples include country or state, race, and gender. Each possible value of the variable is assigned one color from a qualitative palette.

In a qualitative palette, the colors assigned to each group need to be distinct. As a rule of thumb, you should try to limit the maximum palette size to 10 or fewer colors. With more colors than this, you start to run into trouble distinguishing between groups. If you have more possible values than colors, then you should try to bundle values together, like setting the smallest categories to a single “other” category. Looping through colors multiple times is a bad idea, as this can cause confusion.

The smallest slices repeat colors and are hard to see, so we should lump them into a single ‘other’ slice.
The smallest slices on the left not only repeat colors in the palette, they are also fairly difficult to distinguish from one another.

The main way of generating distinctiveness between colors is through their hues. Additional variation can be obtained by adjusting lightness and saturation, but it’s a good idea not to make the differences too large. Too much difference might suggest that some colors are more important than others — though this can be useful when used deliberately. Avoid having two colors with the same…

Michael Yi
Nightingale

Jack of many disciplines, interested in games, data, mathematics, and applying mathematics and data to games. Content writer and manager at Chartio.