-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Label log minor ticks if only one log major tick is drawn. #29054
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
Bumping, at least for discussion? |
I think it makes sense for the default behavior! I do not fully understand the consequences if someone provides a value, though, and therefore how "much breaking" this is. |
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.
This makes sense to me and seems like a sensible change to the default.
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.
IMHO the change is ok, even though it's technically breaking. I doubt somebody is explicitly relying (or wanting) the preivious behavior.
In general, avoiding axis with a single labeled tick seems to be a good idea. Previously, a log axis spanning from 4 to 60 would have its minor ticks unlabeled, LogFormatter making that choice based on the fact that the axis spans more than one decade (60/4>10). Instead, change the interpretation of the first item in `minor_thresholds` to label the minor ticks (by default) if there is only one (or zero) major tick drawn (as is the case for the above axis limits).
In general, avoiding axis with a single labeled tick seems to be a good idea. Previously, a log axis spanning from 4 to 60 would have its minor ticks unlabeled, LogFormatter making that choice based on the fact that the axis spans more than one decade (60/4>10). Instead, change the interpretation of the first item in
minor_thresholds
to label the minor ticks (by default) if there is only one (or zero) major tick drawn (as is the case for the above axis limits).Closes #29050, but probably needs to be discussed as that's technically an API break. However, note that this doesn't break any test and I suspect that this case may have been missed previously (I added a test for it).
PR summary
PR checklist