Title: Off-by-one bug in annual axis labels when localized time crosses year boundary · Issue #12675 · matplotlib/matplotlib · GitHub
Open Graph Title: Off-by-one bug in annual axis labels when localized time crosses year boundary · Issue #12675 · matplotlib/matplotlib
X Title: Off-by-one bug in annual axis labels when localized time crosses year boundary · Issue #12675 · matplotlib/matplotlib
Description: Bug report Bug summary When plotting dates with time zone information on the x-axis, under certain circumstances, the wrong year will be displayed as the label. Code for reproduction import matplotlib.pyplot as plt import pytz from datet...
Open Graph Description: Bug report Bug summary When plotting dates with time zone information on the x-axis, under certain circumstances, the wrong year will be displayed as the label. Code for reproduction import matplot...
X Description: Bug report Bug summary When plotting dates with time zone information on the x-axis, under certain circumstances, the wrong year will be displayed as the label. Code for reproduction import matplot...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12675
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Off-by-one bug in annual axis labels when localized time crosses year boundary","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nWhen plotting dates with time zone information on the x-axis, under certain circumstances, the wrong year will be displayed as the label.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport pytz\r\nfrom datetime import datetime, timedelta\r\n\r\nx = [datetime(2010, 1, 1, tzinfo=pytz.timezone('America/New_York')) + timedelta(i) for i in range(2000)]\r\nplt.plot(x, [0] * len(x));\r\n```\r\n\r\n**Actual outcome**\r\n\r\nThe first label on the plot is 2009.\r\n\r\n**Expected outcome**\r\n\r\nThe first label on the plot is 2010.\r\n\r\n**Matplotlib version**\r\n\r\nBuilt this morning from master. Also confirmed the issue on 3.0.0 and confirmed that 2.2.2 does not have the issue (or at least not with the reproduction steps I found.)\r\n\r\n * Operating system: Debian 7.11\r\n * Matplotlib version: from source\r\n * Matplotlib backend module://ipykernel.pylab.backend_inline\r\n * Python version: 3.7.0\r\n * Jupyter version (if applicable): 4.4.0\r\n * Other libraries: pytz 2018.5\r\n\r\nI built matplotlib from source to verify that this bug affects master. The checks against 3.0.0 and 2.2.2 were done on a conda install of those versions and may have had different versions of pytz and jupyter.","author":{"url":"https://github.com/paulgb","@type":"Person","name":"paulgb"},"datePublished":"2018-10-30T14:48:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/12675/matplotlib/issues/12675"}
| 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:b067c65a-d1dd-ab46-f869-0799ac5e1960 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C970:2FC742:2C80657:3BDDADC:6A53B9E0 |
| html-safe-nonce | c8cbb572c8bdfe82a7ef9f9444c3363c328181303dc08e2b66656158bedb2b12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTcwOjJGQzc0MjoyQzgwNjU3OjNCRERBREM6NkE1M0I5RTAiLCJ2aXNpdG9yX2lkIjoiNDQwNDU3NDEwNzI2MzU0Nzg3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fb6d7813ea8a95afd9b37f3a2daf3d4e9c1596fc260cf964e8aee75d51b2e3e4 |
| hovercard-subject-tag | issue:375528845 |
| 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/12675/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e67d9ea3f379a3901674d15cec77fbd88ac4e17539db4704ad0bf32aeeb97b55/matplotlib/matplotlib/issues/12675 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e67d9ea3f379a3901674d15cec77fbd88ac4e17539db4704ad0bf32aeeb97b55/matplotlib/matplotlib/issues/12675 |
| og:image:alt | Bug report Bug summary When plotting dates with time zone information on the x-axis, under certain circumstances, the wrong year will be displayed as the label. Code for reproduction import matplot... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | paulgb |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width