# Any tips to differentiate zero and non-zero values on a map with a continuous color scale?

This is more a theoretical/best practices question than a practical one, but imagine I have to make a map with points representing cities, and some variable is tied to the points color. The value itself is important of course, but so is knowing if that value is 0 or not, as it can denote presence/absence of the trait of interest.

How to convey the fact that 0% and 0.5% are different values with a color scale that goes from 0 to 100%?

I tried displaying the 0 values in a completely different color (mostly gray), but it looks like it's missing values more than it's 0. Adding a symbol on top feels clunky and unnecessarily confusing.

Any tips, or even better maps where you think this has been well-executed, would be appreciated. Thank you.

• This is more a cartographic question than a statistical one, suggesting you might get better-informed answers at Geographic Information Systems.
– whuber
Commented Jul 24 at 18:12

One possibility would be to use a black-body or heated body palette (which you should do in any case to indicate any kind of ordered or numerical variable). Assuming your variable is nonnegative, let the color scale run from black for low to yellow for high values.

Then use black for zero, and skip a small step in the color scale, such that small nonzero values don't appear as dark red/brown, but as a lighter shade. In the R code in the link above, that can easily be introduced using an additional min_value parameter.

Plus, of course, give a meaningful legend, including a distinctive color (gray or white) for missings, which is also shown in the legend.

An alternative would be to just give a legend with a color for missings that is clearly distinct from your color for zeros... even if there are no missings in the visualization. (Which could, however, confuse some people.)

Use a non-linear color scale if you like to stress specific small changes.

When you do that, be aware that you do not trick the viewers of your graph by exaggerating the difference when it is not as relevant. Why is the difference between 0% and 0.5% a big difference? If this is the case, then potentially you could use a different scale instead of the percentage scale (e.g. a logit scale).

On this Dutch website grafiekpolitie (graph police), an example is given how the creative use of special colours and scales to stress particular differences can be confusing and misleading.

Image: Sjoerd Huisman Winnifred Wijnker Peter Burger 30 juni 2023 Grafiekpolitie | Hittekaart woningmarkt leidt gebruikers op dwaalspoor

If you do use an alternative scale, then potentially you could place the color scale with sufficient and clear labels, to allow people to inform them selves better about the scale.

I notice that I have used on this website alternative scales like below from the question If I have a 58% chance of winning a point, what's the chance of me winning a ping pong game to 21, win by 2?

In the color scale you can see extra tick lines for the stronger gradient of the color change. On second thoughts, I could have made this more salient by adding labels to those ticks. That could help the readers to see that the blue-purple colour change, for values below -100 where the steps are 10 instead of 100, occurs in a smaller range.

It sounds like you are coloring points, not areas. If so, you could distinguish exact 0s from near-0s by the plotting character's point shape or border color. For example:

• Exact 0s are square; near-0s and all other points are round
• All are round, but exact 0s have a bright red border with the 0 color inside; near-0s and all other points have a black border

In addition to the other answers' good advice about color scales, I will also recommend the viridis color scales. There is an R package with documentation examples, demonstrating how some color scales are not perceptually uniform, making them hard to read (especially if you have any color blindness or if you print in grayscale).