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

Skip to content

Rely on numpy to properly normalize histograms with unequal bin widths #8333

Closed
@anntzer

Description

@anntzer

The source of hist contains the following snippets:

        Notes
        -----
        Until numpy release 1.5, the underlying numpy histogram function was
        incorrect with `normed`=`True` if bin sizes were unequal.  MPL
        inherited that error.  It is now corrected within MPL when using
        earlier numpy versions.
        # hist_kwargs = dict(range=range, normed=bool(normed))
        # We will handle the normed kwarg within mpl until we
        # get to the point of requiring numpy >= 1.5.

and code for manual handling of the normed kwarg.

Given that we now require numpy >=1.7.1, we should just use the density kwarg to numpy.histogram to do this, and remove our own implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions