Skip to content

Plotting updates (scorecards, paper revision) - #77

Open
treigerm wants to merge 18 commits into
mainfrom
plots-revision
Open

Plotting updates (scorecards, paper revision)#77
treigerm wants to merge 18 commits into
mainfrom
plots-revision

Conversation

@treigerm

@treigerm treigerm commented Sep 1, 2026

Copy link
Copy Markdown
Member

This PR makes some changes to the plotting code, namely:

  • Add the plotting code for the scorecards.
  • Some stylistic changes made to the plots during the paper revision.
  • Allow to skip the variable level plots which take a long time if applied to all variables and error bounds.

I have also sneaked in a change to compress.py which allows to overwrite the existing compressor results (useful when re-running the compression pipeline).

Comment thread src/climatebenchpress/compressor/plotting/constants.py Outdated
Comment thread src/climatebenchpress/compressor/plotting/plot_metrics.py Outdated
):
"""Creates all the plots which only depend on a single variable."""
for dataset in all_results["Dataset"].unique():
if dataset != "cmip6-access-tos":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why skip?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah this is some quick and dirty filtering that shouldn't have slipped in. Removed now.

Comment thread src/climatebenchpress/compressor/plotting/plot_metrics.py Outdated
# Passing a file handle hides the suffix from matplotlib, so it
# falls back to the default PNG format and writes PNG bytes into
# a .pdf file. Pass the Path directly so the format is inferred.
fig.savefig(outfile, dpi=300, bbox_inches="tight")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could still pass f but also set format="pdf", which would still support the virtual file system

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. Changed!

@treigerm

treigerm commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Thanks for the review @juntyr , I've made the changes!

@juntyr

juntyr commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

@treigerm You can merge this PR once you're happy with it

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.

2 participants