Title: Inconsistency between documentation and actual effect of the bar plot function · Issue #8327 · matplotlib/matplotlib · GitHub
Open Graph Title: Inconsistency between documentation and actual effect of the bar plot function · Issue #8327 · matplotlib/matplotlib
X Title: Inconsistency between documentation and actual effect of the bar plot function · Issue #8327 · matplotlib/matplotlib
Description: Bug report Bug summary There is an inconsistency between the matplotlib's documentation and actual outcome of the bar plot function. The documentation says that left argument in the bar plot function indicate the x coordinates of the lef...
Open Graph Description: Bug report Bug summary There is an inconsistency between the matplotlib's documentation and actual outcome of the bar plot function. The documentation says that left argument in the bar plot functi...
X Description: Bug report Bug summary There is an inconsistency between the matplotlib's documentation and actual outcome of the bar plot function. The documentation says that left argument in the bar plot fu...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8327
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistency between documentation and actual effect of the bar plot function","articleBody":"### Bug report\r\n\r\n#### Bug summary\r\nThere is an inconsistency between the [matplotlib's documentation](http://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.bar.html#matplotlib.axes.Axes.bar) and actual outcome of the bar plot function. The documentation says that `left` argument in the bar plot function indicate\r\n\u003ethe x coordinates of the left sides of the bars\r\n\r\nIn fact, the `left` parameter indicate the center of the bar.\r\n\r\n#### Code for reproduction\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nN = 3\r\nwidth = 1.0\r\nstat = [2.4, 3.2, 1.6]\r\nind = np.arange(1, 6, 2, dtype=np.float32)\r\n\r\nfig, ax = plt.subplots()\r\nax.bar(ind, stat, width )\r\nax.set_xticks(ind+width/2.0)\r\nplt.show()\r\n```\r\n\r\n#### Actual outcome and expected outcome\r\nThe x axis ticks should be in the center of bar if the documentation is right. In fact, the ticks are in the right side of each bar. See figure below\r\n\r\n\r\n#### Matplotlib version\r\n\r\n- Matplotlib version: 2.0.0\r\n- Python version: 2.7.13 and 3.5.2\r\n- Platform: Linux (CentOS 7) and Windows \r\n- How did you install Matplotlib and Python: Anaconda\r\n","author":{"url":"https://github.com/jdhao","@type":"Person","name":"jdhao"},"datePublished":"2017-03-18T06:24:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8327/matplotlib/issues/8327"}
| 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:5a7c3c96-90b0-f5e7-1886-e2eb2a6b94b6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E30:2181C5:27C82F:36C373:6A546D40 |
| html-safe-nonce | 56f3a733620bec738c03aa2ac2e5d9f4457aead1686f34c1520bc6bd32e02337 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTMwOjIxODFDNToyN0M4MkY6MzZDMzczOjZBNTQ2RDQwIiwidmlzaXRvcl9pZCI6IjMxNTIzNTAxMTU1MDQ4NzY4NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b9348a9f65dd66ae141a7d2748e2157fc5d9515f5da66eea8083d657dec56a67 |
| hovercard-subject-tag | issue:215170486 |
| 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/8327/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c8a18f58b55dd490fae442ccee42e16a6cf73a3654cfc414a4f9a22c6fbb58ee/matplotlib/matplotlib/issues/8327 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c8a18f58b55dd490fae442ccee42e16a6cf73a3654cfc414a4f9a22c6fbb58ee/matplotlib/matplotlib/issues/8327 |
| og:image:alt | Bug report Bug summary There is an inconsistency between the matplotlib's documentation and actual outcome of the bar plot function. The documentation says that left argument in the bar plot functi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jdhao |
| 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