Skip to content

hist() no longer respects range=... when density=True #13982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anntzer opened this issue Apr 18, 2019 · 1 comment · Fixed by #13989
Closed

hist() no longer respects range=... when density=True #13982

anntzer opened this issue Apr 18, 2019 · 1 comment · Fixed by #13989
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Apr 18, 2019

Bug report

Bug summary

Code for reproduction

_, bins, _ = plt.hist(np.random.rand(10), "auto", range=(0, 1), density=True)
print(bins)

Actual outcome

[0.00331535 0.18930174 0.37528813 0.56127453 0.74726092 0.93324731]

Expected outcome

Some array where the first value is 0 and the last one is 1.

Note that this bug doesn't happen if density=False.

Bisects to 239be7b (#8638).

Matplotlib version

  • Operating system: linux
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())): any
  • Python version: 37
  • Jupyter version (if applicable): no
  • Other libraries: numpy 1.16.2
@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Apr 18, 2019
@anntzer anntzer added this to the v3.1.0 milestone Apr 18, 2019
@tacaswell
Copy link
Member

💢 I was about to tag....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants