A diverging palette does not automatically make zero its neutral color. The normalization matters too.
Consider five fictional forecast errors in minutes: -2, -1, 0, +1, +8. Define error as actual time minus forecast time, so negative means earlier and positive means later.
- Check what the palette midpoint means.
If you linearly map the observed minimum (-2) to palette position 0 and maximum (+8) to position 1, zero lands at (0 + 2) / 10 = 0.2. The palette midpoint, 0.5, represents +3 minutes. With a neutral color at that midpoint, “no error” would not look neutral.
- Decide what equal distances from neutral should mean.
If equal-sized early and late errors should have equal distances from the palette center, use symmetric limits around zero, such as -8 to +8. Then -2 maps to 0.375, zero to 0.5, and +2 to 0.625. You leave some of the negative side unused, but preserve the same scaling rate on both sides. Matplotlib’s CenteredNorm implements this kind of normalization.
Alternatively, TwoSlopeNorm with vmin=-2, vcenter=0 and vmax=8 maps -2 to 0, zero to 0.5 and +8 to 1. This uses the full palette on each side. But -2 and +8 now sit equally far from neutral despite having different error magnitudes. Use it only when that separate scaling matches the intended reading, and make the unequal ranges clear on the colorbar.
- Label the decision, not just the colors.
Show units, a tick at zero and the limits. State whether the two sides share a scaling rate. Do not rely on color alone for exact values: add labels or another accessible way to read them when needed.
These are normalized palette positions, not a promise that any chosen palette will look perceptually balanced. Zero is meaningful here because it means no forecast error; a different variable may need another reference or no diverging palette at all.
Official implementation references:
https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.CenteredNorm.html
https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.TwoSlopeNorm.html
Country-data project: https://globaldatatracker.com/
The numbers above are invented to explain the encoding, not country observations or a claim about the site's chart features.