FIX: Generalize Colorbar Scale Handling#18887
Closed
jklymak wants to merge 8 commits intomatplotlib:masterfrom
Closed
FIX: Generalize Colorbar Scale Handling#18887jklymak wants to merge 8 commits intomatplotlib:masterfrom
jklymak wants to merge 8 commits intomatplotlib:masterfrom
Conversation
394d0d2 to
2ff255a
Compare
jklymak
commented
Nov 4, 2020
| formatter = self.formatter | ||
| if locator is None: | ||
| if self.boundaries is None: | ||
| if isinstance(self.norm, colors.NoNorm): |
Member
Author
There was a problem hiding this comment.
I seem to have managed to drop NoNorm which I guess means this section of code had no tests. Anyone know what this is supposed to do?
jklymak
commented
Nov 4, 2020
| linthresh=self.norm.linthresh, | ||
| base=10) | ||
| else: | ||
| if mpl.rcParams['_internal.classic_mode']: |
Member
Author
There was a problem hiding this comment.
I'm biting the bullet and just removing this. This changes 10 of the image tests below and a few of the fixed values in test_colorbar, but otherwise has no ill effect. Its hard to wrap this as a special case just for linear scales/norms, and I don't see any reason to do this.
2ff255a to
49fd84f
Compare
49fd84f to
6180df7
Compare
Member
Author
|
Closing in favour of #18900 |
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
The goal here is that every Norm has a
_scaleassociated with it, and the_scaletells colorbar what scale to use on its long axis. This would all be trivial except for the fact that if we have colorbar extends, the usual axes extends past where we want ticks drawn. So all our Locators need to be wrapped to not draw pastvminandvmax(within some tolerance!). Before we were special casingLogLocatorandAutoLocator, so this just generalizes..Note that users can still set their own locators manually, but if they did that before they wouldn't get the trimming either.
PR Checklist
pytestpasses).flake8on changed files to check).flake8-docstringsand runflake8 --docstring-convention=all).doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).