@@ -6351,7 +6351,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6351
6351
supported by `numpy.histogram_bin_edges`: 'auto', 'fd', 'doane',
6352
6352
'scott', 'stone', 'rice', 'sturges', or 'sqrt'.
6353
6353
6354
- range : tuple or None, optional
6354
+ range : tuple or None, optional, default: None
6355
6355
The lower and upper range of the bins. Lower and upper outliers
6356
6356
are ignored. If not provided, *range* is ``(x.min(), x.max())``.
6357
6357
Range has no effect if *bins* is a sequence.
@@ -6360,28 +6360,25 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6360
6360
is based on the specified bin range instead of the
6361
6361
range of x.
6362
6362
6363
- Default is ``None``
6364
-
6365
- density : bool, optional
6363
+ density : bool, optional, default: False
6366
6364
If ``True``, the first element of the return tuple will
6367
- be the counts normalized to form a probability density, i.e.,
6368
- the area (or integral) under the histogram will sum to 1.
6369
- This is achieved by dividing the count by the number of
6370
- observations times the bin width and not dividing by the total
6371
- number of observations. If *stacked* is also ``True``, the sum of
6372
- the histograms is normalized to 1.
6365
+ be the raw counts per bin normalized to form a probability density
6366
+ so that the area under the histogram will integrate to 1, i.e.
6367
+ ``np.sum(n * np.diff(bins)) == 1``. (Computed by dividing the
6368
+ raw counts ``n0`` by the total number of data points and
6369
+ multiplying by the bin width: ``n = n0 / sum(n0) * np.diff(bins)``)
6370
+
6371
+ If *stacked* is also ``True``, the sum of the histograms is
6372
+ normalized to 1.
6373
6373
6374
- Default is ``False``.
6375
6374
6376
- weights : (n, ) array-like or None, optional
6375
+ weights : (n, ) array-like or None, optional, default: None
6377
6376
An array of weights, of the same shape as *x*. Each value in *x*
6378
6377
only contributes its associated weight towards the bin count
6379
6378
(instead of 1). If *normed* or *density* is ``True``,
6380
6379
the weights are normalized, so that the integral of the density
6381
6380
over the range remains 1.
6382
6381
6383
- Default is ``None``.
6384
-
6385
6382
This parameter can be used to draw a histogram of data that has
6386
6383
already been binned, e.g. using `numpy.histogram` (by treating each
6387
6384
bin as a single point with a weight equal to its count) ::
@@ -6391,7 +6388,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6391
6388
6392
6389
(or you may alternatively use `~.bar()`).
6393
6390
6394
- cumulative : bool or -1, optional
6391
+ cumulative : bool or -1, optional, default: False
6395
6392
If ``True``, then a histogram is computed where each bin gives the
6396
6393
counts in that bin plus all bins for smaller values. The last bin
6397
6394
gives the total number of datapoints.
@@ -6404,15 +6401,13 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6404
6401
``True``, then the histogram is normalized such that the first bin
6405
6402
equals 1.
6406
6403
6407
- Default is ``False``
6408
6404
6409
- bottom : array-like, scalar, or None
6405
+ bottom : array-like, scalar, or None, default: None
6410
6406
Location of the bottom baseline of each bin. If a scalar,
6411
6407
the base line for each bin is shifted by the same amount.
6412
6408
If an array, each bin is shifted independently and the length
6413
6409
of bottom must match the number of bins. If None, defaults to 0.
6414
6410
6415
- Default is ``None``
6416
6411
6417
6412
histtype : {'bar', 'barstacked', 'step', 'stepfilled'}, optional
6418
6413
The type of histogram to draw.
@@ -6426,55 +6421,47 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6426
6421
6427
6422
Default is 'bar'
6428
6423
6429
- align : {'left', 'mid', 'right'}, optional
6424
+ align : {'left', 'mid', 'right'}, optional, default 'mid'
6430
6425
The horizontal alignment of the histogram bars.
6431
6426
6432
6427
- 'left': bars are centered on the left bin edges.
6433
6428
- 'mid': bars are centered between the bin edges.
6434
6429
- 'right': bars are centered on the right bin edges.
6435
6430
6436
- Default is 'mid'
6437
6431
6438
6432
orientation : {'horizontal', 'vertical'}, optional
6439
6433
If 'horizontal', `~matplotlib.pyplot.barh` will be used for
6440
6434
bar-type histograms and the *bottom* kwarg will be the left edges.
6441
6435
6442
- rwidth : scalar or None, optional
6436
+ rwidth : scalar or None, optional, default: None
6443
6437
The relative width of the bars as a fraction of the bin width. If
6444
6438
``None``, automatically compute the width.
6445
6439
6446
6440
Ignored if *histtype* is 'step' or 'stepfilled'.
6447
6441
6448
- Default is ``None``
6449
6442
6450
- log : bool, optional
6443
+ log : bool, optional, default: False
6451
6444
If ``True``, the histogram axis will be set to a log scale. If
6452
6445
*log* is ``True`` and *x* is a 1D array, empty bins will be
6453
6446
filtered out and only the non-empty ``(n, bins, patches)``
6454
6447
will be returned.
6455
6448
6456
- Default is ``False``
6457
-
6458
- color : color or array-like of colors or None, optional
6449
+ color : color or array-like of colors or None, optional, default: None
6459
6450
Color or sequence of colors, one per dataset. Default (``None``)
6460
6451
uses the standard line color sequence.
6461
6452
6462
6453
Default is ``None``
6463
6454
6464
- label : str or None, optional
6455
+ label : str or None, optional, default: None
6465
6456
String, or sequence of strings to match multiple datasets. Bar
6466
6457
charts yield multiple patches per dataset, but only the first gets
6467
6458
the label, so that the legend command will work as expected.
6468
6459
6469
- default is ``None``
6470
-
6471
- stacked : bool, optional
6460
+ stacked : bool, optional, default:False
6472
6461
If ``True``, multiple data are stacked on top of each other If
6473
6462
``False`` multiple data are arranged side by side if histtype is
6474
6463
'bar' or on top of each other if histtype is 'step'
6475
6464
6476
- Default is ``False``
6477
-
6478
6465
Returns
6479
6466
-------
6480
6467
n : array or list of arrays
0 commit comments