heatmap with OCF color scale centered at 0 with fixed range -3500 to 3500#377
heatmap with OCF color scale centered at 0 with fixed range -3500 to 3500#377ram-from-tvl wants to merge 2 commits intoopenclimatefix:mainfrom
Conversation
…cast, ate heatmap to use OCF color scale centered at 0 with fixed range -3500 to 3500
|
Hi @peterdudfield |
|
Hi @peterdudfield |
It looks like you have one run of bold colours, then another run of light colours. Could you actually just use the bold colours for the full scale? Other 0 colours is very similar to 3500 which could be confusing. |
There was a problem hiding this comment.
Pull request overview
This PR implements a custom OCF colorscale for the adjuster heatmap visualization, centered at zero with a fixed range of -3500 to 3500, making it easier to compare positive and negative adjuster values. It also adds an informative note explaining that adjuster values are subtracted from forecasts.
Key changes:
- Added a centered diverging colorscale with OCF brand colors (blue to teal to orange)
- Set fixed scale range (-3500 to 3500) with center at zero for consistent visualization across different models
- Added user-facing note explaining the meaning of positive/negative adjuster values
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Define OCF colorscale using only bold colors for full range | ||
| colorscale = [ | ||
| [0, '#4675c1'], # Bold blue (negative values) | ||
| [0.25, '#65b0c9'], # Bold cyan | ||
| [0.5, '#58b0a9'], # Bold teal (around zero) | ||
| [0.75, '#ffd480'], # Bold yellow-orange | ||
| [1, '#faa056'] # Bold orange (positive values) | ||
| ] |
There was a problem hiding this comment.
The PR description mentions using 10 OCF colors (#4675c1, #65b0c9, #58b0a9, #ffd480, #faa056, #9cb6e1, #a3d6e0, #9ed1cd, #ffe9bc, #ffdabc), but the implementation only uses 5 of these colors. The last 5 colors appear to be lighter/pastel versions of the first 5. While using 5 colors for a diverging scale is reasonable, this discrepancy between the PR description and implementation should be clarified. If the intent was to use all 10 colors, the colorscale definition should be updated. If 5 colors is the correct approach, the PR description should be updated to reflect this.
| # Define OCF colorscale using only bold colors for full range | ||
| colorscale = [ | ||
| [0, '#4675c1'], # Bold blue (negative values) | ||
| [0.25, '#65b0c9'], # Bold cyan | ||
| [0.5, '#58b0a9'], # Bold teal (around zero) |
There was a problem hiding this comment.
The colorscale uses teal (#58b0a9) as the center color for zero values. In typical diverging colorscales centered at zero (like the RdBu scale suggested in issue #376), the center is usually a neutral color (white, gray, or light yellow) to clearly distinguish between positive and negative values. Using teal as the center color may make it harder to quickly identify zero or near-zero values at a glance. Consider using a more neutral color for the center point (position 0.5) to improve visual clarity.
| # Define OCF colorscale using only bold colors for full range | |
| colorscale = [ | |
| [0, '#4675c1'], # Bold blue (negative values) | |
| [0.25, '#65b0c9'], # Bold cyan | |
| [0.5, '#58b0a9'], # Bold teal (around zero) | |
| # Define OCF colorscale using bold colors for extremes and a neutral center at zero | |
| colorscale = [ | |
| [0, '#4675c1'], # Bold blue (negative values) | |
| [0.25, '#65b0c9'], # Bold cyan | |
| [0.5, '#ffffff'], # Neutral white (around zero) |
|
hi @peterdudfield |

Pull Request
Description
zmid=0to center the scale around zero, making it easier to compare positive and negative valueszmin=-3500andzmax=3500as suggested in the issue, ensuring consistent color intensity for values in this rangeFixes #376
Checklist: