Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6410,10 +6410,11 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
"""
Plot a histogram.

Compute and draw the histogram of *x*. The return value is a
tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*,
[*patches0*, *patches1*,...]) if the input contains multiple
data.
Compute and draw the histogram of *x*. The return value is a tuple
(*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*, [*patches0*,
*patches1*,...]) if the input contains multiple data. See the
documentation of the *weights* parameter to draw a histogram of
already-binned data.

Multiple data can be provided via *x* as a list of datasets
of potentially different length ([*x0*, *x1*, ...]), or as
Expand Down Expand Up @@ -6487,7 +6488,16 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
the weights are normalized, so that the integral of the density
over the range remains 1.

Default is ``None``
Default is ``None``.

This parameter can be used to draw a histogram of data that has
already been binned, e.g. using `np.histogram` (by treating each
bin as a single point with a weight equal to its count) ::

counts, bins = np.histogram(data)
plt.hist(bins[:-1], bins, weights=counts)

(or you may alternatively use `~.bar()`).

cumulative : bool, optional
If ``True``, then a histogram is computed where each bin gives the
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy