Title: bars in plt.bar graph centered on "left" value · Issue #8882 · matplotlib/matplotlib · GitHub
Open Graph Title: bars in plt.bar graph centered on "left" value · Issue #8882 · matplotlib/matplotlib
X Title: bars in plt.bar graph centered on "left" value · Issue #8882 · matplotlib/matplotlib
Description: Bug report Bug summary Docstring for plt.bar: matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs) Make a bar plot. Make a bar plot with rectangles bounded by: left, left + width, bottom, bottom + h...
Open Graph Description: Bug report Bug summary Docstring for plt.bar: matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs) Make a bar plot. Make a bar plot with rectangles bounded by...
X Description: Bug report Bug summary Docstring for plt.bar: matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs) Make a bar plot. Make a bar plot with rectangles bounded by...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8882
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bars in plt.bar graph centered on \"left\" value","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\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\n\r\nDocstring for plt.bar:\r\n\r\n\u003e \r\n\u003e matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs)\r\n\u003e Make a bar plot.\r\n\u003e \r\n\u003e Make a bar plot with rectangles bounded by:\r\n\u003e \r\n\u003e left, left + width, bottom, bottom + height\r\n\u003e (left, right, bottom and top edges)\r\n\u003e \r\n\r\nHowever, \"left\" is in fact the center value of the resulting bars.\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\n# Paste your code here\r\n#\r\n#\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nlefts = np.asarray((0, 100, 200, 300, 400))\r\nplt.bar(left=lefts, height=lefts, width=100)\r\nplt.bar(left=lefts, height=lefts, width=75)\r\nplt.bar(left=lefts, height=lefts, width=50)\r\nplt.bar(left=lefts, height=lefts, width=25)\r\n\r\n```\r\n\r\n**Actual outcome**\r\n\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# If applicable, paste the console output here\r\n#\r\n#\r\n```\r\n\r\n**Expected outcome**\r\nBars should be left-aligned to the \"left\" value.\r\nAs the attached plot shows: Bars are centered on \"left\" value, and not left-aligned to it.\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\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: Fedora Linux 26\r\n * Matplotlib Version: 2.0.2\r\n * Python Version: 3.6\r\n * Jupyter Version (if applicable):\r\n * Other Libraries: \r\n\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\nmatplotlib installed using pip","author":{"url":"https://github.com/skjaeve","@type":"Person","name":"skjaeve"},"datePublished":"2017-07-15T13:34:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/8882/matplotlib/issues/8882"}
| 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:a1cc7bac-12e5-b1d6-9b47-80f787cfd654 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D284:23AA91:1B06CFA:24BE76C:6A547F6D |
| html-safe-nonce | 38292b12e1d3e472b036cbbfbcd0a8fa01040c00cede136b959a9d904f76139d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjg0OjIzQUE5MToxQjA2Q0ZBOjI0QkU3NkM6NkE1NDdGNkQiLCJ2aXNpdG9yX2lkIjoiODEyMDc5NDk5MzkxOTI5NTM0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f5e93f4794e00f118a8cce80f837b8ae2b5006275f9a6aba103af32cddd8b897 |
| hovercard-subject-tag | issue:243175691 |
| 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/8882/issue_layout |
| twitter:image | https://opengraph.githubassets.com/918a0d08adbfb65ce669790e9e41d64d51666213dc22e0c68cdeb974f3714d7b/matplotlib/matplotlib/issues/8882 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/918a0d08adbfb65ce669790e9e41d64d51666213dc22e0c68cdeb974f3714d7b/matplotlib/matplotlib/issues/8882 |
| og:image:alt | Bug report Bug summary Docstring for plt.bar: matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs) Make a bar plot. Make a bar plot with rectangles bounded by... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skjaeve |
| 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 | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width