Skip to content

Histogram compatibility with numpy #7364

Closed

Description

@rancomp

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?

Activity

  1. added
    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …
    on Oct 30, 2016
  2. added this to the milestone on Oct 30, 2016
  3. added
    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
    on Oct 30, 2016
  4. tacaswell commented on Oct 30, 2016

    @tacaswell
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: consistencyConsistency of the matplotlib API, including naming, behavior, defaults, …Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issues

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions