-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH:made default tick formatter to switch to scientific notation earlier #14832
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
The default tick formatter switches to scientific notation only for very small values, but there is a range of slightly bigger values where scientific notation would be better too. changed the formatter limits from -7,7 to -5,5 closes #14800
This prob needs an API change note, and you probably need to edit the default |
Add note in api section and changed new defaults in matplotlibrc
@@ -1157,3 +1157,8 @@ result in undefined behavior. It now throws a `ValueError`. | |||
|
|||
The signature of the (private) ``Axis._update_ticks`` has been changed to not | |||
take the renderer as argument anymore (that argument is unused). | |||
|
|||
Reduced default value of `axes.formatter.limits` |
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.
Sorry, should have been clear about where this goes. it gets a new file in doc/api/next-api-changes/
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.
@jklymak I am not able to exactly understand the naming convention of the files in doc/api/next-api-changes/
. For eg, in 2019-05-08-AL.rst
what exactly does AL mean?
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.
AL
are the authors initials. Which is a bit mysterious, i.e. in that case "Antony Lee".
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.
And the date is the date of modification? Right?
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.
Yes; rough is fine.
Moved api change note from prev_api_change/api_changes/3.1.0.rst to next_api_changes/2019-07-18-SL.rst
There are two failing image comparison tests because of the change. How do we want to handle these? I propose to set the defaults back to -7, 7 for these tests. It's not worth or necessary regenerating the images. |
@timhoffm Do you mean revert the change in matplotlibrc to -5, 5 ? |
Yes, at the beginning of these two tests, just add
Note: There's no need to revert that setting at the end of the test because each test starts with the default settings. |
I see. I made the required changes. Thanks for the info @timhoffm! |
Sorry, I may not have been clear enough. I don't think we should apply this to all image comparison tests, but only on a case-by-case basis in the actual test functions where it's necessary to get the the tests pass without regenerating the baseline images (IIRC that have been two tests). |
Sorry, I think I misunderstood you. But thank you for helping me out. 👍 I think I have made the required changes |
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.
The code looks fine, but I don't know about the defaults change.
Seems reasonable, but has anyone thought about what this does to large numbers? We might want to have asymmetric thresholds. |
@tacaswell Good point. Maybe - |
@timhoffm I think -5, 6 would be appropriate. I can make that change |
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.
Blocking to prevent merge before the large-number limit is resolved.
We have a lot of approvals for the current state of -5, 5. But I would prefer -5, 6. Do we agree on that?
... piling on: It'd be nice for a test w the new limits. It would also clarify the new behaviour and why this limit is better, because otherwise I'm not sure I follow. |
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.
My issues have been addressed. We need a second re-approval.
@jklymak What exactly would you like to test. I wouldn‘t want to create an image for this.
ping @jklymak do you need additional tests? |
Reduced default value of `axes.formatter.limits` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Changed the default value of `axes.formatter.limits` from -7, 7 to -5, 6 for better readability. |
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.
@sameshl If you get a chance could you add a .. plot
example to the API change note? It greatly helps people who are skimming the release note to understand the change!
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.
Modulo an example plot in the API change note.
@tacaswell I will update api note with the |
I will open a PR with the example, merged to keep things moving. Thanks @sameshl ! |
Thanks for taking up the example @tacaswell ! |
Done in #15137 |
The default tick formatter switches to scientific notation only for very small values,
but there is a range of slightly bigger values where scientific notation would be better too.
changed the formatter limits from -7,7 to -5,5
closes #14800
PR Summary
PR Checklist