-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: Generalize Colorbar Scale Handling #18887
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
Conversation
394d0d2
to
2ff255a
Compare
@@ -577,30 +533,19 @@ def _get_ticker_locator_formatter(self): | |||
""" | |||
locator = self.locator | |||
formatter = self.formatter | |||
if locator is None: | |||
if self.boundaries is None: | |||
if isinstance(self.norm, colors.NoNorm): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
linthresh=self.norm.linthresh, | ||
base=10) | ||
else: | ||
if mpl.rcParams['_internal.classic_mode']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Closing in favour of #18900 |
PR Summary
The goal here is that every Norm has a
_scale
associated with it, and the_scale
tells 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 pastvmin
andvmax
(within some tolerance!). Before we were special casingLogLocator
andAutoLocator
, 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
pytest
passes).flake8
on changed files to check).flake8-docstrings
and 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).