Skip to content

Fix Logscale color normalization in contourf #10561

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gcaria
Copy link
Contributor

@gcaria gcaria commented Jul 22, 2025

@dcherian dcherian requested a review from Illviljan July 23, 2025 21:58
@Illviljan
Copy link
Contributor

This needs tests.

Do we want to be able to tweak the locator though? It's been very for rare for me to want it at least, using norm has worked fine for me.

Contour(f) doesn't play that nice with norm unfortunately so I think trying to get the default values to work better will make most happy.
Did you try out #10565, @gcaria ?

# extend is a keyword argument only for contour and contourf, but
# passing it to the colorbar is sufficient for imshow and
# pcolormesh
kwargs["extend"] = cmap_params["extend"]
kwargs["levels"] = cmap_params["levels"]
if not (
"locator" in kwargs and isinstance(kwargs["locator"], ticker.LogLocator)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"locator" in kwargs and isinstance(kwargs["locator"], ticker.LogLocator)
isinstance(kwargs.get("locator"), ticker.LogLocator)

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

Successfully merging this pull request may close these issues.

Logscale color normalization in contourf
2 participants