Skip to content

heatmap with OCF color scale centered at 0 with fixed range -3500 to 3500#377

Open
ram-from-tvl wants to merge 2 commits intoopenclimatefix:mainfrom
ram-from-tvl:fix-adjuster-colorscale
Open

heatmap with OCF color scale centered at 0 with fixed range -3500 to 3500#377
ram-from-tvl wants to merge 2 commits intoopenclimatefix:mainfrom
ram-from-tvl:fix-adjuster-colorscale

Conversation

@ram-from-tvl
Copy link
Contributor

@ram-from-tvl ram-from-tvl commented Oct 22, 2025

Pull Request

Description

  • Replaced the default heatmap colors with a custom OCF color scale using the provided colors: #4675c1, #65b0c9, #58b0a9, #ffd480, #faa056, #9cb6e1, #a3d6e0, #9ed1cd, #ffe9bc, #ffdabc
  • Set zmid=0 to center the scale around zero, making it easier to compare positive and negative values
  • Fixed the scale range with zmin=-3500 and zmax=3500 as suggested in the issue, ensuring consistent color intensity for values in this range

Fixes #376

Checklist:

  • My code follows OCF's coding style guidelines
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked my code and corrected any misspellings
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation

…cast, ate heatmap to use OCF color scale centered at 0 with fixed range -3500 to 3500
@ram-from-tvl
Copy link
Contributor Author

Hi @peterdudfield
Please let me know if these changes are good to go.
Thank you!

@ram-from-tvl
Copy link
Contributor Author

image

@ram-from-tvl
Copy link
Contributor Author

Hi @peterdudfield
please let me know if this colorscale looks good or if any changes are required.
Thank you!

@peterdudfield
Copy link
Contributor

Hi @peterdudfield please let me know if this colorscale looks good or if any changes are required. Thank you!

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.

Copilot AI review requested due to automatic review settings January 6, 2026 14:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +55 to +62
# 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)
]
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +59
# 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)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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)

Copilot uses AI. Check for mistakes.
@ram-from-tvl
Copy link
Contributor Author

hi @peterdudfield
I have made some changes now.
Please let me know if its good to go.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix colour scale for adjuster plots

3 participants