Title: Specifying histtype='stepfilled' and normed=True when using plt.hist causes ymax to be set incorrectly · Issue #4414 · matplotlib/matplotlib · GitHub
Open Graph Title: Specifying histtype='stepfilled' and normed=True when using plt.hist causes ymax to be set incorrectly · Issue #4414 · matplotlib/matplotlib
X Title: Specifying histtype='stepfilled' and normed=True when using plt.hist causes ymax to be set incorrectly · Issue #4414 · matplotlib/matplotlib
Description: The combination of histtype='stepfilled' and normed=True seem to cause some problems with the max ylimit. import matplotlib.pyplot as plt import seaborn.apionly as sns iris = sns.load_dataset('iris') plt.figure() for species, species_df ...
Open Graph Description: The combination of histtype='stepfilled' and normed=True seem to cause some problems with the max ylimit. import matplotlib.pyplot as plt import seaborn.apionly as sns iris = sns.load_dataset('iris...
X Description: The combination of histtype='stepfilled' and normed=True seem to cause some problems with the max ylimit. import matplotlib.pyplot as plt import seaborn.apionly as sns iris = sns.load_datas...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/4414
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Specifying histtype='stepfilled' and normed=True when using plt.hist causes ymax to be set incorrectly","articleBody":"The combination of `histtype='stepfilled'` and `normed=True` seem to cause some problems with the max ylimit.\n\n``` python\nimport matplotlib.pyplot as plt\nimport seaborn.apionly as sns\niris = sns.load_dataset('iris')\n\nplt.figure()\nfor species, species_df in iris.groupby(\"species\"):\n plt.hist(species_df[\"petal_length\"].values, normed=True, histtype=\"stepfilled\")\nplt.legend(sorted(iris.species.unique()))\n```\n\n\nWhich is not the case when only using `histtype='stepfilled'`.\n\n``` python\nplt.figure()\nfor species, species_df in iris.groupby(\"species\"):\n plt.hist(species_df[\"petal_length\"].values, histtype=\"stepfilled\")\n```\n\n\nOr when only using `normed=True`.\n\n``` python\nplt.figure()\nfor species, species_df in iris.groupby(\"species\"):\n plt.hist(species_df[\"petal_length\"].values, normed=True)\n```\n\n\nIt seems like in the erroneous case above, the max of the yaxis is set by the last plotted distribution, which can be tested by changing the order of when the different histograms are plotted.\n\n``` python\nplt.figure()\niris.loc[iris.species == 'setosa', 'species'] = 'wsetosa'\nfor species, species_df in iris.groupby(\"species\"):\n plt.hist(species_df[\"petal_length\"].values, normed=True, histtype=\"stepfilled\")\nplt.legend(sorted(iris.species.unique()))\n```\n\n\n","author":{"url":"https://github.com/joelostblom","@type":"Person","name":"joelostblom"},"datePublished":"2015-05-07T20:19:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/4414/matplotlib/issues/4414"}
| 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:bfd47aa3-4560-fa8a-f6d6-633944bd86c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B78C:2269D6:EC1E7:15B561:6A57760D |
| html-safe-nonce | d0c2228bbd6a600cc0a8e989fe0cebeeb41b7aef3ef3776ccc63ef742a21d450 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzhDOjIyNjlENjpFQzFFNzoxNUI1NjE6NkE1Nzc2MEQiLCJ2aXNpdG9yX2lkIjoiMzI5OTQ4NzY2MzQ3NzE5MjIwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 715379e6be11eb02f544fc38ece97768a5dfe3c546058ab4a57b65785682de8e |
| hovercard-subject-tag | issue:74113513 |
| 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/4414/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ad19258e105afbf29a84340d8cf3d0e3f72d32811d5183fa76f8c73ec28aa86e/matplotlib/matplotlib/issues/4414 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ad19258e105afbf29a84340d8cf3d0e3f72d32811d5183fa76f8c73ec28aa86e/matplotlib/matplotlib/issues/4414 |
| og:image:alt | The combination of histtype='stepfilled' and normed=True seem to cause some problems with the max ylimit. import matplotlib.pyplot as plt import seaborn.apionly as sns iris = sns.load_dataset('iris... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | joelostblom |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | c0ca805e53f128ba1f966be1d3ccd81d0d1959c7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width