Title: For hist() with uneven bins, histtype=bar and stepfilled interpret align=left/right differently · Issue #12494 · matplotlib/matplotlib · GitHub
Open Graph Title: For hist() with uneven bins, histtype=bar and stepfilled interpret align=left/right differently · Issue #12494 · matplotlib/matplotlib
X Title: For hist() with uneven bins, histtype=bar and stepfilled interpret align=left/right differently · Issue #12494 · matplotlib/matplotlib
Description: Bug report Bug summary I'm not really sure what align=left/right is even supposed to mean for uneven bins, but at least histype=bar/stepfilled should interpret them in the same manner (or both should error out). Code for reproduction fro...
Open Graph Description: Bug report Bug summary I'm not really sure what align=left/right is even supposed to mean for uneven bins, but at least histype=bar/stepfilled should interpret them in the same manner (or both shou...
X Description: Bug report Bug summary I'm not really sure what align=left/right is even supposed to mean for uneven bins, but at least histype=bar/stepfilled should interpret them in the same manner (or both ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12494
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"For hist() with uneven bins, histtype=bar and stepfilled interpret align=left/right differently","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\nI'm not really sure what align=left/right is even supposed to mean for uneven bins, but at least histype=bar/stepfilled should interpret them in the same manner (or both should error out).\r\n\r\n**Code for reproduction**\r\n\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\nfrom pylab import *\r\n\r\nnp.random.seed(0)\r\nt = np.random.rand(100)\r\nfig, axs = plt.subplots(3, 2, sharex=True, sharey=True)\r\nfor i, align in enumerate([\"left\", \"mid\", \"right\"]):\r\n for j, ht in enumerate([\"bar\", \"stepfilled\"]):\r\n axs[i, j].hist(t, [0, 1/4, 1], histtype=ht, align=align)\r\n axs[i, j].set(xlabel=f\"histtype={ht!r}\", ylabel=f\"align={align!r}\")\r\n axs[i, j].label_outer()\r\n\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nEither consistent plots with both histtypes, or an error indicating that align=left/right is incompatible with uneven bins.\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:\r\n * Matplotlib version: master\r\n * Matplotlib backend (`print(matplotlib.get_backend())`):\r\n * Python version:\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\nNoted while thinking about #12493.\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/anntzer","@type":"Person","name":"anntzer"},"datePublished":"2018-10-11T23:10:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/12494/matplotlib/issues/12494"}
| 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:65f1eaf7-a67e-a7b6-91e3-bdebe41b2ec6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B0AE:3DC42C:5CF150:7C9558:6A52F9ED |
| html-safe-nonce | c5e32589411f99cc0ddc539eb0a36d5d054f39c66edf1aebef4a159c3def7cff |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEFFOjNEQzQyQzo1Q0YxNTA6N0M5NTU4OjZBNTJGOUVEIiwidmlzaXRvcl9pZCI6Ijc4NDExNTc5ODgzMzMzMjA2ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | df3a5ac49b441d1b9914e9584abe3e26abe58eb0a8d1ef7955311d2a6ec95229 |
| hovercard-subject-tag | issue:369340459 |
| 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/12494/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cccc6906b4db2934e2e8eb5d2cb542f94d514fdda46deedd7f333961b6043364/matplotlib/matplotlib/issues/12494 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cccc6906b4db2934e2e8eb5d2cb542f94d514fdda46deedd7f333961b6043364/matplotlib/matplotlib/issues/12494 |
| og:image:alt | Bug report Bug summary I'm not really sure what align=left/right is even supposed to mean for uneven bins, but at least histype=bar/stepfilled should interpret them in the same manner (or both shou... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anntzer |
| 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