Repository navigation
FIX: LogNorm masks non-positive values when vmin and vmax are equal - #32601
Merged
Merged
Conversation
Member
We have been discussing fixing this, but it’s a non-trivial topic: #26307 |
Member
Author
|
Thanks @timhoffm. I thought the problem seemed vaguely familiar but couldn’t remember where I saw it. The notes tell me I attended both of the meetings where it was discussed. Anyway, I think we can fix the mask without worrying about the colorbar mismatch for now. |
timhoffm
approved these changes
Nov 15, 2026
story645
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
Fixes #32599 I think.
When the norm's vmin and vmax are equal, previously we simply returned a plain numpy array of zeros. Where the scale transforms the input to invalid values we should mask those points. So use the transformed array and fill the resulting masked array with zeros.
The example from the issue now gives
I'm not sure we can do much about the fact you get a different colour when the colorbar is added. I think that may have been a deliberate decision about colorbar at some point.
AI Disclosure
None used.
PR quality check