-
-
Notifications
You must be signed in to change notification settings - Fork 22
heatmap with OCF color scale centered at 0 with fixed range -3500 to 3500 #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,8 @@ def adjuster_page(): | |
| url = 'https://www.notion.so/openclimatefix/Adjuster-cae707fbac0a440895f8aacec2a7b55c?pvs=4' | ||
| st.markdown(f'<a href="{url}" target="_blank">Link to Notion page</a>', unsafe_allow_html=True) | ||
|
|
||
| st.markdown("**Note:** Adjuster values are subtracted from the forecast. Positive adjuster values will reduce the forecast.") | ||
|
|
||
| connection = DatabaseConnection(url=os.environ["DB_URL"], echo=True) | ||
| with connection.get_session() as session: | ||
| # get all the models with adjust values | ||
|
|
@@ -50,9 +52,19 @@ def adjuster_page(): | |
| index="time_of_day", columns="forecast_horizon_minutes", values="value" | ||
| ) | ||
|
|
||
| # 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) | ||
| ] | ||
|
Comment on lines
+55
to
+62
|
||
|
|
||
| fig = go.Figure( | ||
| data=go.Heatmap( | ||
| z=metric_values_df.values, x=metric_values_df.columns, y=metric_values_df.index | ||
| z=metric_values_df.values, x=metric_values_df.columns, y=metric_values_df.index, | ||
| colorscale=colorscale, zmid=0, zmin=-3500, zmax=3500 | ||
| ), | ||
| layout=go.Layout( | ||
| title=go.layout.Title(text=f"Adjuster Value for {model_name}"), | ||
|
|
||
There was a problem hiding this comment.
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.