-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Allow turning off minor ticks on Colorbar with LogNorm #13265
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
Allow turning off minor ticks on Colorbar with LogNorm #13265
Conversation
Allow turning off minor ticks on Colorbar with LogNorm
Looks good! Can you also remove the check that prevents turning them back on? Does anyone know why we did this in the first place? |
#11584 (comment) Looks to just have been a misunderstanding.... |
Also allow minorticks_on for LogNorm
Uh oh, this is probably going to be more complicated than I thought. It makes sense to remove the check that prevents turning ticks back on with LogNorm, but then it still needs an else. I am not sure how to do it right. Do not know why minor ticks are enabled in ColorbarBase for LogNorm but for everything else the methods are in Colorbar. |
That might just be a mistake? |
I actually think the minor tick methods should go on |
This looks good! Can you add a unit test? |
Made an attempt. Edit: I really should have just setup the environment to run pytest locally, would have saved me time in seeing the miss-named import. |
Add unit tests
8899bae
to
eb411d0
Compare
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.
LGTM. Thanks @LevN0 !
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.
Thanks!
Thank you everyone for the guidance, especially @jklymak. |
Allow turning off minor ticks on Colorbar with LogNorm
PR Summary
Closes #13257.
Allows disabling minor ticks for Colorbar when it has LogNorm.
Before
Minor ticks can be disabled for all norms except LogNorm.
The following example is intended to show that when having arbitrary major tick marks, the minor tick marks add rather than remove confusion. Example,
Produces,
After
Once minor ticks can be disabled even for LogNorm, calling cbar.minorticks_off() will leave only major ticks in the above figure.
Allow minorticks back on for LogNorm as well
Since minor ticks can now be turned off for LogNorm, makes sense to allow turning them back on for LogNorm too.
Previously they would be enabled in
ColorbarBase.update_ticks
for LogNorm by default, however minorticks_off and minorticks_off was inColorbar
. These have been moved, in part so thatupdate_ticks
can take advantage of them.PR Checklist