Title: YearLocator should prefer ticks at the turn of the decade · Issue #9838 · matplotlib/matplotlib · GitHub
Open Graph Title: YearLocator should prefer ticks at the turn of the decade · Issue #9838 · matplotlib/matplotlib
X Title: YearLocator should prefer ticks at the turn of the decade · Issue #9838 · matplotlib/matplotlib
Description: Bug summary YearLocator is agnostic about decades. Ticks at the decades are nicer, so when choosing a starting value in some cases it should prefer to start a the turn of the decade or even mid decade. i.e 1970 instead of 1968, 1965 inst...
Open Graph Description: Bug summary YearLocator is agnostic about decades. Ticks at the decades are nicer, so when choosing a starting value in some cases it should prefer to start a the turn of the decade or even mid dec...
X Description: Bug summary YearLocator is agnostic about decades. Ticks at the decades are nicer, so when choosing a starting value in some cases it should prefer to start a the turn of the decade or even mid dec...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9838
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"YearLocator should prefer ticks at the turn of the decade","articleBody":"**Bug summary**\r\n\r\n`YearLocator` is agnostic about decades. Ticks at the decades are nicer, so when choosing a starting value in some cases it should prefer to start a the turn of the decade or even mid decade. i.e 1970 instead of 1968, 1965 instead of 1964. This \"smart\" behaviour should apply when the intervals are factors of 5 and 10. \r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport datetime\r\nimport matplotlib.pyplot as plt\r\n\r\nx = [datetime.datetime(1966, 1, 1),\r\n datetime.datetime(2017, 1, 1)]\r\n\r\nticks = [datetime.datetime(i, 1, 1)\r\n for i in range(1970, 2020, 10)]\r\n\r\ny = np.arange(len(x))\r\nfig, ax = plt.subplots()\r\nax.plot_date(x, y)\r\n# ax.set_xticks(ticks) # preferred ticks\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n**Better outcome**\r\n","author":{"url":"https://github.com/has2k1","@type":"Person","name":"has2k1"},"datePublished":"2017-11-23T07:54:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/9838/matplotlib/issues/9838"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c77ae112-8077-add4-b6ac-4b0b0830b626 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA18:2D857A:20FCAA5:2D1C216:6A53906A |
| html-safe-nonce | fdcc43152bc14138a915dcd81afba88ad1029384d0204e4394e9e012e0f6afa3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTE4OjJEODU3QToyMEZDQUE1OjJEMUMyMTY6NkE1MzkwNkEiLCJ2aXNpdG9yX2lkIjoiMjU4NDU5NDA3MjIwNDQ0Nzg1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 26deb1135bc29e2531045bded0fee4bceb4625e0b82b024c40b4978c2faa4876 |
| hovercard-subject-tag | issue:276288323 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/matplotlib/matplotlib/9838/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c0511a16b8d6750647fb6c775f8f7533cbab21e166030e84010d957b66027e05/matplotlib/matplotlib/issues/9838 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c0511a16b8d6750647fb6c775f8f7533cbab21e166030e84010d957b66027e05/matplotlib/matplotlib/issues/9838 |
| og:image:alt | Bug summary YearLocator is agnostic about decades. Ticks at the decades are nicer, so when choosing a starting value in some cases it should prefer to start a the turn of the decade or even mid dec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | has2k1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| 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 | false |
| 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