-
Notifications
You must be signed in to change notification settings - Fork 279
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
ENH: add support for symlog colorbars with arbitrary bases (requires MPL>=3.5) #4449
Conversation
1a7f2c8
to
6f5084e
Compare
db179ec
to
8b41771
Compare
Still having 4 errors in pytest-mpl tests, 3 of which are identical and all of which result from leaning more on matplotlib to determine major ticks in symlog, and only affect edge cases. I believe these differences are acceptable (desirable, even). Next step will be to open a discussion with matplotlib devs to see which part of this work (if any) they'd be interested in upstreaming. |
This looks good to me, and great work proposing it for upstreaming. |
pre-commit.ci autofix |
f310150
to
c3f9109
Compare
Turns out merely keeping bug-for-bug compatibility for MPL<3.5 adds a lot of complexity to |
e8bd650
to
00aa803
Compare
00aa803
to
e696ad9
Compare
Alright this is now stable enough for review. All remaining image failures are expected and intended, the companion PR for the baseline submodule may be found at yt-project/yt_pytest_mpl_baseline#3 |
e696ad9
to
e7c96fa
Compare
e7c96fa
to
7d3a0af
Compare
@matthewturk the companion PR should have been merged first ! I'll open a follow up PR to fix tests on main |
TST: bump pytest-mpl tests (follow up to GH #4449)
PR Summary
replay #4447 + closes #4448
While the set of minor ticks on a log scale isn't well defined in the general case (say, natural log), I find that our existing approach for log10 (
get_symlog_(minor|major)ticks()
) can be generalized to work with any integer base. This is essentially what I'm doing here, using pure MPL API. For non-integer bases, I delegate to matplotlib (which is equivalent of giving up minor ticks).As noted in #4448, I found it was very hard (likely impossible) to fix the issue with matplotlib older than 3.5, so for these versions, I'm keeping bug-for-bug compatibility.
TODO:
I also opened matplotlib/matplotlib#25994 but the further I dig in, the less likely it looks that this will have a swift, short term solution upstream, so I'm not making its resolution a requirement for this PR.