-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: resolve an issue where no ticks would be drawn for a colorbar with SymLogNorm and ranging exactly from 0 to linthresh #25970
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
FIX: resolve an issue where no ticks would be drawn for a colorbar with SymLogNorm and ranging exactly from 0 to linthresh #25970
Conversation
aac9ad3
to
97dafb4
Compare
It appears that it did not break any. |
Yup, I saw that after the first run, added a test, rebased and force pushed :) |
I see that this PR is part of the First Time Contributors project with status "Status: Waiting for author. Can anyone tell me if there's anything else I should be doing ? |
Sorry I should have updated the status when I switched the labels. Now done. |
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 wondering if you could get the desired effect for your edge case more simply/efficiently by modifying “simple mode”. If I have understood, your data are all within the linear range if we consider that range to be inclusive of its limits.
matplotlib/lib/matplotlib/ticker.py
Lines 2499 to 2503 in 97dafb4
# "simple" mode is when the range falls entirely within (-t, | |
# t) -- it should just display (vmin, 0, vmax) | |
if -linthresh < vmin < vmax < linthresh: | |
# only the linear range is present | |
return [vmin, vmax] |
97dafb4
to
09054ef
Compare
@rcomer indeed, I didn't consider that but it does what I wanted and more. I updated the branch with your suggestion, thanks a lot ! |
d40df8b
to
d385da6
Compare
…th SymLogNorm and ranging exactly from 0 to linthresh Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
d385da6
to
a3306b2
Compare
Thanks, and congratulations on your first contribution to Matplotlib! We'd be happy to see you back. |
PR summary
closes #25945
I'd like to see if this breaks any existing test before I add a new one.
PR checklist