FIX: Only send one update signal when autoscaling norms#25079
Merged
ksunden merged 1 commit intomatplotlib:mainfrom Jan 25, 2023
Merged
FIX: Only send one update signal when autoscaling norms#25079ksunden merged 1 commit intomatplotlib:mainfrom
ksunden merged 1 commit intomatplotlib:mainfrom
Conversation
Signal are sent for every vmin/vmax update, when autoscaling we were changing vmin/vmax to None, then updating them which would cause 4 update signals to be sent. We really don't care about the intermediate signals and only want a single one sent after all the udpates are complete.
jklymak
reviewed
Jan 25, 2023
Comment on lines
+1365
to
+1369
| with self.callbacks.blocked(): | ||
| # Pause callbacks while we are updating so we only get | ||
| # a single update signal at the end | ||
| self.vmin = self.vmax = None | ||
| self.autoscale_None(A) |
Member
There was a problem hiding this comment.
Maybe just?
Suggested change
| with self.callbacks.blocked(): | |
| # Pause callbacks while we are updating so we only get | |
| # a single update signal at the end | |
| self.vmin = self.vmax = None | |
| self.autoscale_None(A) | |
| if A.size(): | |
| self.vmin = A.min() | |
| self.vmax = A.max() |
Contributor
Author
There was a problem hiding this comment.
subclasses overwrite autoscale_None() to handle that themselves, so I think we need to defer to their implementations. I'd save that for another PR if someone wants to tackle it.
Member
|
I'm still a little grumpy about |
jklymak
approved these changes
Jan 25, 2023
ksunden
approved these changes
Jan 25, 2023
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Jan 25, 2023
…utoscaling norms
QuLogic
added a commit
that referenced
this pull request
Jan 25, 2023
…079-on-v3.7.x Backport PR #25079 on branch v3.7.x (FIX: Only send one update signal when autoscaling norms)
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
Signal are sent for every vmin/vmax update, when autoscaling we were changing vmin/vmax to None, then updating them which would cause 4 update signals to be sent. We really don't care about the intermediate signals and only want a single one sent after all the updates are complete.
closes #25077
NOTE: The colorbar says "if not norm.scaled(): set vmin/vmax to 0, 1" which doesn't work for the LogNorm scales. Perhaps we should also change that arbitrary 0, 1 expansion. But, this at least makes sure we don't go through the
vmin=Nonepath here while we are actively updating the norm.PR Checklist
Documentation and Tests
pytestpasses)Release Notes
.. versionadded::directive in the docstring and documented indoc/users/next_whats_new/.. versionchanged::directive in the docstring and documented indoc/api/next_api_changes/next_whats_new/README.rstornext_api_changes/README.rst