Title: Reduce AutoDateFormatter precision when possible by matthijskooijman · Pull Request #4809 · matplotlib/matplotlib · GitHub
Open Graph Title: Reduce AutoDateFormatter precision when possible by matthijskooijman · Pull Request #4809 · matplotlib/matplotlib
X Title: Reduce AutoDateFormatter precision when possible by matthijskooijman · Pull Request #4809 · matplotlib/matplotlib
Description: Previously, the AutoDateFormatter would choose a format with second or microsecond precision, even when the ticks were significantly coarser than that. The resulting extra precision looks weird and can clutter the display (especially with the long microsecond display). This commit changes the default scale to format dictionary, which now works as follows: Use microsecond precision when the ticks are less than a second apart Use second precision when the ticks are seconds apart Use minute precision when the ticks are minutes or hours apart Use day-precision, month or year precision when the ticks are days or more apart (unchanged). Note that there is no point in displaying only the hour when the ticks are hours apart, since then it won't be immediately clear that a time is being displayed. Adding the (technically superfluous) :00 for the minutes should make it immediately obvious that a time is being displayed, which is why the minute precision should also be used when the ticks are hours apart. While updating the documentation for this change, it was also changed to use symbolic constants instead of hardcoded numbers. This should make it more clear what the intention is. Closes: #4808
Open Graph Description: Previously, the AutoDateFormatter would choose a format with second or microsecond precision, even when the ticks were significantly coarser than that. The resulting extra precision looks weird and...
X Description: Previously, the AutoDateFormatter would choose a format with second or microsecond precision, even when the ticks were significantly coarser than that. The resulting extra precision looks weird and...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/4809
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:928cf290-ac14-51c9-d1c1-af3643fca863 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A2BE:17CF54:1CA40CB:270BF21:6A54028B |
| html-safe-nonce | 7f743532e79ed6b409f0936b5f2bdbf4d6c76a6002feccfd4557c680ccb06ebb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkJFOjE3Q0Y1NDoxQ0E0MENCOjI3MEJGMjE6NkE1NDAyOEIiLCJ2aXNpdG9yX2lkIjoiNTEzODY1NjExMzQ3MDk5NzEzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ea2423c12ba144ed32d3334acdf100b83542ff1a09b89d80fb7173fffa550e6 |
| hovercard-subject-tag | pull_request:41033658 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/pull/4809/files |
| twitter:image | https://avatars.githubusercontent.com/u/194491?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/194491?s=400&v=4 |
| og:image:alt | Previously, the AutoDateFormatter would choose a format with second or microsecond precision, even when the ticks were significantly coarser than that. The resulting extra precision looks weird and... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width