Using Colors in your Data Visualizations
A Simple Guide on using Color correctly in your Visualizations
This article is for people who find it hard selecting the right colors for their visualizations
For most of us data analysts, trying to select the right colors to properly illustrate the information we want to communicate in our visualizations often presents itself as a challenging task for us, and for obvious reasons. 😩We are not designers and never really took the time to learn how to design, because that's an entire field on its own. But with little adjustments and following some visualization rules of thumb, you can drastically improve your visualization and even design skill just by understanding the three following principles of using color in data visualization.
Color🌈 is an important element in Visualization and the way we use colors in our visualisation could drastically change the perception of our visuals and our choice of color is hugely dependent on the data type we are working with.
Here are the three rules of thumb to follow for when ever you have a challenge in selecting colors for your visualizations.
There are three fundamental ways colors are used in data visualization. We use colors to:
- Distinguish between discrete categorical variables
- Represent continous data values
- And highlight important data elements
Colors to Distinguish Between Discrete Categories
When creating a plot that involves distinguishing between categorical variables i.e. gender, country etc, we make use of a qualitative color scale/palette.
The scale contains a finite set of specific colors that are chosen to look clearly distinct from each other while also being equivalent to each other.

It helps to clearly distinguish between multiple categories without infering any sort of similarity between the categories.
When selecting a sequential color palette/scale, you must make sure that no one color values stands out relative to the others to avoid perception of column and also, the colors should not create an impression of order as you would see below.
Figure 1.

Note: the figures are purely for illustrative purposes and do not reflect real information
Figure 2.

Colors to Represent Continuous Data Values
When representing continuous data values, we make use of a sequential color scale. The scale contains a sequence of colors that clearly indicates a range of large to small values and also give a perception or order between variables.

Sequential color scale could be single hue or multiple hues, multiple hues can be used when you are trying to show more than one category of data or higher value ranges.
And also the color scale needs to be perceived to vary uniformly across its entire range for balance.
Here are some examples when using a sequential palette
Figure 1.

Figure 2.

Additionally you could also make use of a Diverging Color Scale.
Diverging color scale can be seen as two Sequential Color Scale joined together at a mid-point which is commonly used when dealing with negative values or ranges that have two extremes with a baseline in the middle.

Colors to Highlight
Color is an effective tool to highlight specific elements in your visualization, allowing you to direct focus to specific categories or values that carry key information about the story you want to tell.
You can achieve this effect, is by using a set of colors that vividly stand out against the rest of the figure.
This is done by using an accent color scale. Accent colors are basically qualitative color palettes with come colors desaturated and others darkened or combining gray values with colors.

Example:
Figure 1.

Conclucion
Selecting colors for your visualization is one out of a number of factors for effective data communication, but selecting the right colour alone would make a massive difference on the perception and interpretation of your information.
Also if your looking for how to select color palettes, make use of online color palette pickers such as colorbrewer, colordesigner.io and numerous others.
Thank you for your time
Feel free to check me out on X @BenjOkezie