Title: [Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths · Issue #28223 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths · Issue #28223 · matplotlib/matplotlib
X Title: [Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths · Issue #28223 · matplotlib/matplotlib
Description: Bug summary Issue Description: When using ax.barh to visualize intervals, the function fails to display all intervals under certain conditions, which appears to be linked to the width of the intervals specified as duration. Specifically,...
Open Graph Description: Bug summary Issue Description: When using ax.barh to visualize intervals, the function fails to display all intervals under certain conditions, which appears to be linked to the width of the interv...
X Description: Bug summary Issue Description: When using ax.barh to visualize intervals, the function fails to display all intervals under certain conditions, which appears to be linked to the width of the interv...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28223
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths","articleBody":"### Bug summary\n\n**Issue Description:**\r\n\r\nWhen using ax.barh to visualize intervals, the function fails to display all intervals under certain conditions, which appears to be linked to the width of the intervals specified as duration. Specifically, intervals with a duration of 3 hours are not displayed properly, while increasing the duration to 5 hours results in correct visualization. This issue suggests a potential problem with how interval widths are handled or rendered in ax.barh.\r\n\r\n**Steps to Reproduce:**\r\nRefer to \"code for reproduction\"\r\n\r\n**Expected Behavior:**\r\n\r\nAll intervals should be visualized consistently, regardless of their duration width.\r\n\r\n**Actual Behavior:**\r\n\r\nIntervals with a shorter duration (3 hours) are not visualized correctly, while longer durations (5 hours) are displayed as expected.\n\n### Code for reproduction\n\n```Python\nfrom datetime import datetime, timedelta\r\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\n\r\nduration = timedelta(hours=3)\r\n# duration = timedelta(hours=5)\r\nax.barh(y=0, width=duration, left=datetime(2024, 1, 1, 6))\r\nax.barh(y=1, width=duration, left=datetime(2024, 1, 1, 1))\r\n\r\nplt.xticks(rotation=45)\r\nplt.tight_layout()\r\nplt.savefig('bug.png')\n```\n\n\n### Actual outcome\n\nOnly one of two bars is rendered.\r\n\r\n\n\n### Expected outcome\n\nI expect both bars to appear:\r\n\r\n\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nUbuntu and Manjaro\n\n### Matplotlib Version\n\n3.8.4\n\n### Matplotlib Backend\n\nagg\n\n### Python version\n\n3.11.8\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/AndreasLR","@type":"Person","name":"AndreasLR"},"datePublished":"2024-05-14T09:11:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/28223/matplotlib/issues/28223"}
| 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:e65e7fef-0c69-c612-837b-f01553f49ce0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA1E:1187B3:9475EF:C67ED5:6A53143C |
| html-safe-nonce | 81a59a23616755e4d3c0531e06c9641420aeb3b707162cee306dd4cc235cbac7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTFFOjExODdCMzo5NDc1RUY6QzY3RUQ1OjZBNTMxNDNDIiwidmlzaXRvcl9pZCI6IjQxMDYxNzczMjg3NzM3OTY5MjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1bf9d0f16c356e6a5542c2a14c3616ce67669f1019554d9ad0ba8fccb0996015 |
| hovercard-subject-tag | issue:2294888799 |
| 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/28223/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eb38a0489ff8f361e332906aaa9e64af0bd06870e8fae2669e88d00fdaacdbd0/matplotlib/matplotlib/issues/28223 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eb38a0489ff8f361e332906aaa9e64af0bd06870e8fae2669e88d00fdaacdbd0/matplotlib/matplotlib/issues/28223 |
| og:image:alt | Bug summary Issue Description: When using ax.barh to visualize intervals, the function fails to display all intervals under certain conditions, which appears to be linked to the width of the interv... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AndreasLR |
| 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