Title: Bug #4414 by CrazyKsv · Pull Request #6169 · matplotlib/matplotlib · GitHub
Open Graph Title: Bug #4414 by CrazyKsv · Pull Request #6169 · matplotlib/matplotlib
X Title: Bug #4414 by CrazyKsv · Pull Request #6169 · matplotlib/matplotlib
Description: Based on the previous class definition of hist(), if only histtype=’stepfilled’ is passed, then normed will default to false and together it causes the histogram to calculate its y-axis limits based on the graphing data. If only normed=True is passed, then histtype will default to ‘bar’ and together it causes the histogram to scale it’s y-axis limits after normalizing graph data. However, when both are provided, the y-axis limits are calculated instead of being scaled, because the previous code does not check if normed=True, which should override the manual calculations of y-axis limits. The bugfix code involves an if statement in the matplotlib/lib/matplotlib/axes/_axes.py hist(...) method that checks the histtype and normed parameters to sets the y limit accordingly. As mentioned above, if the histtype property were not given, then the algorithm would simply scale the graph as if it were a bargraph. However, this is not the case with histtype = “stepfilled”. Since histtype = “stepfilled” is given, it will not scale according to the data, which is why it is imperative to determine the method of scaling before any calculations. The best way to do this is by using an if statement when histtype=’stepfilled’ to check the value of the normed property, and scale accordingly(i.e. Manually calculate dimensions if data not normalized normed=False vs. Auto scale if data is normalized normed=True). #4414
Open Graph Description: Based on the previous class definition of hist(), if only histtype=’stepfilled’ is passed, then normed will default to false and together it causes the histogram to calculate its y-axis limits base...
X Description: Based on the previous class definition of hist(), if only histtype=’stepfilled’ is passed, then normed will default to false and together it causes the histogram to calculate its y-axis limits base...
Opengraph URL: https://github.com/matplotlib/matplotlib/pull/6169
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:bfd6579d-d3fb-36a6-9d56-98ed27abaa43 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C9CA:4EFC8:86F75C:B6DEF2:6A581693 |
| html-safe-nonce | 4d39daabf56a52d48052f2e44bc40fd434cced8fe61329857a2dd5eef9bce8d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOUNBOjRFRkM4Ojg2Rjc1QzpCNkRFRjI6NkE1ODE2OTMiLCJ2aXNpdG9yX2lkIjoiODI1MzE4MDg0MTA1ODM3NTMxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0e97809e995be64cece13a7e67a64faa7280b80d551c4235a71f1d0fac00a5e2 |
| hovercard-subject-tag | pull_request:63146143 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/matplotlib/matplotlib/pull/6169/files |
| twitter:image | https://avatars.githubusercontent.com/u/14336655?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14336655?s=400&v=4 |
| og:image:alt | Based on the previous class definition of hist(), if only histtype=’stepfilled’ is passed, then normed will default to false and together it causes the histogram to calculate its y-axis limits base... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 49c8c15fabcbf356d607a90ca115c13b273e42ff8b74155de050fd229a9b0121 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fb1f684e7a833eb1b2d01d39875a2b52cb4fe9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width