Title: Plot_date default date format is not always the same · Issue #9765 · matplotlib/matplotlib · GitHub
Open Graph Title: Plot_date default date format is not always the same · Issue #9765 · matplotlib/matplotlib
X Title: Plot_date default date format is not always the same · Issue #9765 · matplotlib/matplotlib
Description: Bug report Bug summary In the example below date format is changed when plotting with plot_date after calling dates.DayLocator(). This can be fixed with using dates.DateFormatter(), but the confusion could be avoided if plot_date uses th...
Open Graph Description: Bug report Bug summary In the example below date format is changed when plotting with plot_date after calling dates.DayLocator(). This can be fixed with using dates.DateFormatter(), but the confusi...
X Description: Bug report Bug summary In the example below date format is changed when plotting with plot_date after calling dates.DayLocator(). This can be fixed with using dates.DateFormatter(), but the confusi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9765
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Plot_date default date format is not always the same","articleBody":"\r\n\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nIn the example below date format is changed when plotting with plot_date after calling dates.DayLocator(). This can be fixed with using dates.DateFormatter(), but the confusion could be avoided if plot_date uses the same date format when it is not specified by user.\r\n\r\n\r\n**Code for reproduction**\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\n```python\r\nimport datetime\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.dates as mdates\r\n\r\nDATE1 = mdates.date2num(datetime.datetime(2017, 8, 10, 18, 0))\r\nDATE2 = mdates.date2num(datetime.datetime(2017, 8, 11, 18, 0))\r\nDATE3 = mdates.date2num(datetime.datetime(2017, 8, 12, 18, 0))\r\nplt.plot_date([DATE1, DATE2, DATE3], [1, 2, 3], '-')\r\nplt.show()\r\n\r\nplt.plot_date([DATE1, DATE2, DATE3], [1, 2, 3], '-')\r\nplt.gca().xaxis.set_major_locator(mdates.DayLocator())\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003cimg width=\"575\" alt=\"beforedaylocator\" src=\"https://user-images.githubusercontent.com/14822000/32735913-638bd714-c896-11e7-9f4b-94752e53e3e4.png\"\u003e\r\n\r\n\u003cimg width=\"584\" alt=\"afterdaylocator\" src=\"https://user-images.githubusercontent.com/14822000/32735922-6a0b0aa6-c896-11e7-93be-00c99b04d7ae.png\"\u003e\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Mac OS\r\n * Matplotlib version: 2.0.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`):\r\n * Python version: 2.7.13\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/mirkocoric","@type":"Person","name":"mirkocoric"},"datePublished":"2017-11-13T16:19:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/9765/matplotlib/issues/9765"}
| 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:8ceed3e6-f730-1e1e-837a-64cb50ce052f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD40:3A96BF:977087:CB0D31:6A53FF92 |
| html-safe-nonce | cbcc9b00cf05872ec506874c1ffe3025c99d10de1e105b8103b89efa677d9abf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDQwOjNBOTZCRjo5NzcwODc6Q0IwRDMxOjZBNTNGRjkyIiwidmlzaXRvcl9pZCI6IjY2NzQ2MzI1Nzg1NDMzODY1MTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9fa50b7e7d95a117334eb23f7eacf4f05f8bba801624f262000a0d38a8aa2837 |
| hovercard-subject-tag | issue:273488666 |
| 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/9765/issue_layout |
| twitter:image | https://opengraph.githubassets.com/075ac2e0b1bffe1699d89502ee1fdce0e3b3ad67da2b34a6b555187f74983424/matplotlib/matplotlib/issues/9765 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/075ac2e0b1bffe1699d89502ee1fdce0e3b3ad67da2b34a6b555187f74983424/matplotlib/matplotlib/issues/9765 |
| og:image:alt | Bug report Bug summary In the example below date format is changed when plotting with plot_date after calling dates.DayLocator(). This can be fixed with using dates.DateFormatter(), but the confusi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mirkocoric |
| 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