Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Histogram compatibility with numpy #7364

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
rancomp opened this issue Oct 30, 2016 · 1 comment · Fixed by #8993
Closed

Histogram compatibility with numpy #7364

rancomp opened this issue Oct 30, 2016 · 1 comment · Fixed by #8993
Labels
API: consistency Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Milestone

Comments

@rancomp
Copy link

rancomp commented Oct 30, 2016

In the documentation of numpy's histogram: https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html It is specified the keyword normed will be removed in V2.0 and be replaced with density (due to buggy behavior).

Should matplotlib be compatible with this naming, and atleast accept the keywoard density?

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Oct 30, 2016
@tacaswell tacaswell added Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues new-contributor-friendly labels Oct 30, 2016
@tacaswell
Copy link
Member

👍

We do the our own norm computation for a long fixed issues in numpy < 1.5. Our minimum numpy is 1.6 (and has been since mpl1.4) so we can remove all of that code + update the kwarg.

This is in principle easy, but touching hist can get surprisingly complex surprisingly quickly, so tagging as 'medium' for that reason. However, this change will be relatively self-contained (and should not require touching code outside of hist, hence 'new contributor friendly'.

There is a bunch of special casing farther down the function for when the histogram is normed that will need to be checked to still work.

I think we should differ from numpy a bit here and:

  • set both normed and density to None by default.
  • if both are not None raise
  • covert to 'density' fully internally
  • maintain default behavior of counts (not density)

Bit of git forensics

doing the norm our selves introduced in 2840392

The code around it has been refactored a bit and the note re-formatted, but it looks like it has not been fundamentally changed.


attn @efiring @neggert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: consistency Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants