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
pyplot.hist: normalization fails #6357
Comments
Are you sure that you are interpreting the normalization correctly? It normalizes the area under the curve not the sum of the counts. See #6353 for a similar issue. |
@jenshnielsen Thank you very much for your fast and useful reply. OMG, I was clearly misinterpreting the normalization despite all the comments. I took for granted the approach in which the normalized count is the count in a class divided by the total number of observations. Further away my slip, I suggest to improve the web documentation of pyplot.hist in two ways:
plt.ylabel('Probability') with: plt.ylabel('Probability Density') Thanks again! |
@khyox Can you open up a pull request making those changes to the documentation? |
@tacaswell Of course, Thomas, and very sorry for not having done it yet (about to travel to Japan for the 1st time and a bit bewildered... 👾). |
PR ready! 📦 |
Matplotlib 1.5.1 under python 3.5.1.
The provided example for pyplot.hist is not working as expected for different mu and sigma values:
If the parameters mu and sigma are reduced to:
the plot becomes even more clearly unnormalized:
This fail with normalization also happens for non-gaussian datasets.
The text was updated successfully, but these errors were encountered: