Title: [Bug]: Redundant month in ConciseDateFormatter offset text when it displays days and months · Issue #24982 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Redundant month in ConciseDateFormatter offset text when it displays days and months · Issue #24982 · matplotlib/matplotlib
X Title: [Bug]: Redundant month in ConciseDateFormatter offset text when it displays days and months · Issue #24982 · matplotlib/matplotlib
Description: Bug summary When you make a plot with the ConciseDateFormatter that shows on the x axis days and months the offset_string also shows the month (with the year) which I think is redundant because you only need the year Code for reproductio...
Open Graph Description: Bug summary When you make a plot with the ConciseDateFormatter that shows on the x axis days and months the offset_string also shows the month (with the year) which I think is redundant because you...
X Description: Bug summary When you make a plot with the ConciseDateFormatter that shows on the x axis days and months the offset_string also shows the month (with the year) which I think is redundant because you...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24982
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Redundant month in ConciseDateFormatter offset text when it displays days and months","articleBody":"### Bug summary\r\n\r\nWhen you make a plot with the `ConciseDateFormatter` that shows on the x axis days and months the `offset_string` also shows the month (with the year) which I think is redundant because you only need the year \r\n\r\n\r\n\r\n\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.dates as mdates\r\nimport datetime\r\n\r\nfig, ax = plt.subplots()\r\n\r\nd1 = datetime.datetime(1997, 1, 1)\r\nd2 = d1 + datetime.timedelta(weeks=520)\r\n\r\nlocator = mdates.AutoDateLocator()\r\nformatter = mdates.ConciseDateFormatter(locator)\r\nax.xaxis.set_major_locator(locator)\r\nax.xaxis.set_major_formatter(formatter)\r\n\r\nax.plot([d1, d2], [0, 0])\r\n\r\nax.set_xlim(d1, d1 + datetime.timedelta(weeks=3))\r\nax.set_xlim(d1 + datetime.timedelta(weeks=1),\r\n d1 + datetime.timedelta(weeks=10))\r\n\r\nplt.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n\r\n\r\n### Expected outcome\r\n\r\n\r\n\r\n### Additional information\r\n\r\nWhen the `ConciseDateFormatter` was proposed [here](https://github.com/matplotlib/matplotlib/pull/10841) you can see the same expected behavior:\r\n\r\n\r\n\r\n### Operating system\r\n\r\nUbuntu 22.04.1 LTS\r\n\r\n### Matplotlib Version\r\n\r\n3.6.2\r\n\r\n### Matplotlib Backend\r\n\r\nagg\r\n\r\n### Python version\r\n\r\n3.10.6\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\npip","author":{"url":"https://github.com/persep","@type":"Person","name":"persep"},"datePublished":"2023-01-14T09:25:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/24982/matplotlib/issues/24982"}
| 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:33200c25-d258-edf4-bc47-525cd9b1f3e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8F9C:2CEF5B:252B1C:346292:6A536D52 |
| html-safe-nonce | bf0ee1c6968bf7d2875f5eb2ed9422b3fd7a990204940fadb231fa0e6ed6f2b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjlDOjJDRUY1QjoyNTJCMUM6MzQ2MjkyOjZBNTM2RDUyIiwidmlzaXRvcl9pZCI6IjE3NTMwOTk4ODg0NDEzODgzNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c24038ab723640ae89589352671285677bc6bed1e51a08c0f96527524bb61cc1 |
| hovercard-subject-tag | issue:1533194677 |
| 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/24982/issue_layout |
| twitter:image | https://opengraph.githubassets.com/77da75b653ee0b1425f7d0f6ba7ca7cde00ece982cf83f0264ff7efffa6b4ea3/matplotlib/matplotlib/issues/24982 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/77da75b653ee0b1425f7d0f6ba7ca7cde00ece982cf83f0264ff7efffa6b4ea3/matplotlib/matplotlib/issues/24982 |
| og:image:alt | Bug summary When you make a plot with the ConciseDateFormatter that shows on the x axis days and months the offset_string also shows the month (with the year) which I think is redundant because you... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | persep |
| 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