Skip to content
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

Reversed colormap in create_cmap #81

Merged
merged 3 commits into from
May 4, 2023

Conversation

Beauprel
Copy link
Contributor

@Beauprel Beauprel commented May 3, 2023

This PR allows to add '_r' to the end of a string passed to the cmap argument (for all the functions that have that argument) to get the reversed colormap.

This already is a feature of the matplotlib colormaps - so now it works with the IPCC colormaps as well.

@Beauprel Beauprel linked an issue May 3, 2023 that may be closed by this pull request
Copy link
Collaborator

@sarahclaude sarahclaude left a comment

Choose a reason for hiding this comment

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

It works great!

@@ -1081,7 +1081,7 @@ def heatmap(
fig_kw: dict[str, Any] | None = None,
plot_kw: dict[str, Any] | None = None,
transpose: bool = False,
cmap: str | matplotlib.colors.Colormap | None = "RdBu",
cmap: str | matplotlib.colors.Colormap | None = "temp_div_r",
Copy link
Contributor

Choose a reason for hiding this comment

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

je pense que j'aime mieux garder "RdBu". Il ne s'agit pas de température ici.

@Beauprel Beauprel merged commit 6520292 into main May 4, 2023
@Beauprel Beauprel deleted the 65-reversed-colormap-in-create_cmap branch May 4, 2023 15:51
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.

Reversed colormap in create_cmap()
3 participants