Title: plt.hist chooses improper range when using string-based bin options · Issue #8636 · matplotlib/matplotlib · GitHub
Open Graph Title: plt.hist chooses improper range when using string-based bin options · Issue #8636 · matplotlib/matplotlib
X Title: plt.hist chooses improper range when using string-based bin options · Issue #8636 · matplotlib/matplotlib
Description: plt.hist range bug When using plt.hist with multiple input data sets, not supplying a range, and using a string-based binning option ('auto', for example), the range determined will cut off the later datasets and only fully include the f...
Open Graph Description: plt.hist range bug When using plt.hist with multiple input data sets, not supplying a range, and using a string-based binning option ('auto', for example), the range determined will cut off the lat...
X Description: plt.hist range bug When using plt.hist with multiple input data sets, not supplying a range, and using a string-based binning option ('auto', for example), the range determined will cut off...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/8636
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"plt.hist chooses improper range when using string-based bin options","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### plt.hist range bug\r\n\r\nWhen using plt.hist with multiple input data sets, not supplying a range, and using a string-based binning option ('auto', for example), the range determined will cut off the later datasets and only fully include the first.\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\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\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\ndata = np.random.normal(0, 1, size=1000)\r\ndata2 = np.random.normal(3, 1, size=1000)\r\ndata3 = np.random.normal(6, 1, size=1000)\r\n\r\nplt.hist([data, data2, data3], bins='auto', histtype='stepfilled', stacked=False)\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**Expected outcome**\r\nThis is the plot using the bin-edges as determined by np.histogram using the following code:\r\n```python\r\n_, be = np.histogram([data, data2, data3], bins='auto')\r\nplt.hist([data, data2, data3], bins=be, histtype='stepfilled', stacked=False)\r\n```\r\n\r\n\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: OSX 10.10.5\r\n * Matplotlib Version: 2.0.1\r\n * Python Version: 2.7.13\r\n * Jupyter Version (if applicable): 4.0.6\r\n * Other Libraries: \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\nPython installed via Homebrew, all python packages installed via pip.\r\n","author":{"url":"https://github.com/pollackscience","@type":"Person","name":"pollackscience"},"datePublished":"2017-05-17T17:56:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/8636/matplotlib/issues/8636"}
| 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:675087b0-e0b5-e3c8-6ada-998cf97433b6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE9A:A6E9E:109D034:16131CA:6A541D70 |
| html-safe-nonce | e0dfb2f2655ce6e5d4ba48ac7acfffa6af4aca9982d97d9619eb1e8e61788d7c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTlBOkE2RTlFOjEwOUQwMzQ6MTYxMzFDQTo2QTU0MUQ3MCIsInZpc2l0b3JfaWQiOiI5MDA4NDM2OTU0NDMwNDQ2OTYxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3d58f2684c4bace1ab17b656563b529862b120b800c4b9676110215a8d443e8d |
| hovercard-subject-tag | issue:229438885 |
| 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/8636/issue_layout |
| twitter:image | https://opengraph.githubassets.com/62a48e185118d734f22f572fddc3b71a126309621626a854972f005053df1af1/matplotlib/matplotlib/issues/8636 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/62a48e185118d734f22f572fddc3b71a126309621626a854972f005053df1af1/matplotlib/matplotlib/issues/8636 |
| og:image:alt | plt.hist range bug When using plt.hist with multiple input data sets, not supplying a range, and using a string-based binning option ('auto', for example), the range determined will cut off the lat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pollackscience |
| 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 | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width