Title: Unevenly spaced ticks in plot_date() · Issue #13183 · matplotlib/matplotlib · GitHub
Open Graph Title: Unevenly spaced ticks in plot_date() · Issue #13183 · matplotlib/matplotlib
X Title: Unevenly spaced ticks in plot_date() · Issue #13183 · matplotlib/matplotlib
Description: Bug report When plotting with plot_date(), the x axis ticks can be unevenly spaced. It looks like when the tick spacing is less than a month, the start of the month is always present as a tick, which may mean the space between it and the...
Open Graph Description: Bug report When plotting with plot_date(), the x axis ticks can be unevenly spaced. It looks like when the tick spacing is less than a month, the start of the month is always present as a tick, whi...
X Description: Bug report When plotting with plot_date(), the x axis ticks can be unevenly spaced. It looks like when the tick spacing is less than a month, the start of the month is always present as a tick, whi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/13183
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unevenly spaced ticks in plot_date()","articleBody":"### Bug report\r\n\r\nWhen plotting with `plot_date()`, the x axis ticks can be unevenly spaced. It looks like when the tick spacing is less than a month, the start of the month is always present as a tick, which may mean the space between it and the previous tick is small. This can lead to overlapping tick labels and generally poor looking axes and grids.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\nstart = np.datetime64('2018-01-01', 'D')\r\nend = np.datetime64('2018-04-01', 'D')\r\ndates = np.arange(start, end)\r\ndata = np.random.randn(len(dates))\r\n\r\nplt.plot_date(dates, data)\r\nplt.grid(True)\r\nplt.gcf().autofmt_xdate()\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n\r\n**Expected outcome**\r\n\r\nThe plot should have evenly spaced gridlines and axis ticks, unless a custom locator has specified otherwise.\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: Arch Linux\r\n * Matplotlib version: 3.0.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.7.2\r\n * Jupyter version (if applicable): n/a\r\n * Other libraries: matplotlib 1.15.4\r\n\r\nMatplotlib, Python and numpy are installed with the OS package manager using the standard Arch Linux repositories.","author":{"url":"https://github.com/chrisjbillington","@type":"Person","name":"chrisjbillington"},"datePublished":"2019-01-14T16:38:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/13183/matplotlib/issues/13183"}
| 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:5de6ce10-34b2-39de-fd03-595e1407c950 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB30:226804:B1FFBF:F01E48:6A531961 |
| html-safe-nonce | 779dcacc1eecb6b777fdbba76ea75c631a5756f4b152cf35ae3b9f015f69945b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjMwOjIyNjgwNDpCMUZGQkY6RjAxRTQ4OjZBNTMxOTYxIiwidmlzaXRvcl9pZCI6IjU1NzM3ODIyMzA5MzYwMDA4NjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a3ccd739715765d302696d778c935e69e7d5423857457a59e3f25de5b3aed1d4 |
| hovercard-subject-tag | issue:398973155 |
| 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/13183/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e513ba967821fffcd4d3048addb441de280b8e9c490e1c27774e2db359800c21/matplotlib/matplotlib/issues/13183 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e513ba967821fffcd4d3048addb441de280b8e9c490e1c27774e2db359800c21/matplotlib/matplotlib/issues/13183 |
| og:image:alt | Bug report When plotting with plot_date(), the x axis ticks can be unevenly spaced. It looks like when the tick spacing is less than a month, the start of the month is always present as a tick, whi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chrisjbillington |
| 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