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

Skip to content

Commit 65349e1

Browse files
authored
Merge pull request #16160 from anntzer/histdoc
Cleanup hist() docstring.
2 parents 3574feb + dadf695 commit 65349e1

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6351,7 +6351,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63516351
supported by `numpy.histogram_bin_edges`: 'auto', 'fd', 'doane',
63526352
'scott', 'stone', 'rice', 'sturges', or 'sqrt'.
63536353
6354-
range : tuple or None, optional, default: None
6354+
range : tuple or None, default: None
63556355
The lower and upper range of the bins. Lower and upper outliers
63566356
are ignored. If not provided, *range* is ``(x.min(), x.max())``.
63576357
Range has no effect if *bins* is a sequence.
@@ -6360,7 +6360,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63606360
is based on the specified bin range instead of the
63616361
range of x.
63626362
6363-
density : bool, optional, default: False
6363+
density : bool, default: False
63646364
If ``True``, the first element of the return tuple will
63656365
be the raw counts per bin normalized to form a probability density
63666366
so that the area under the histogram will integrate to 1, i.e.
@@ -6371,8 +6371,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63716371
If *stacked* is also ``True``, the sum of the histograms is
63726372
normalized to 1.
63736373
6374-
6375-
weights : (n, ) array-like or None, optional, default: None
6374+
weights : (n,) array-like or None, default: None
63766375
An array of weights, of the same shape as *x*. Each value in *x*
63776376
only contributes its associated weight towards the bin count
63786377
(instead of 1). If *normed* or *density* is ``True``,
@@ -6388,7 +6387,7 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
63886387
63896388
(or you may alternatively use `~.bar()`).
63906389
6391-
cumulative : bool or -1, optional, default: False
6390+
cumulative : bool or -1, default: False
63926391
If ``True``, then a histogram is computed where each bin gives the
63936392
counts in that bin plus all bins for smaller values. The last bin
63946393
gives the total number of datapoints.
@@ -6401,15 +6400,13 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
64016400
``True``, then the histogram is normalized such that the first bin
64026401
equals 1.
64036402
6404-
64056403
bottom : array-like, scalar, or None, default: None
64066404
Location of the bottom baseline of each bin. If a scalar,
64076405
the base line for each bin is shifted by the same amount.
64086406
If an array, each bin is shifted independently and the length
64096407
of bottom must match the number of bins. If None, defaults to 0.
64106408
6411-
6412-
histtype : {'bar', 'barstacked', 'step', 'stepfilled'}, optional
6409+
histtype : {'bar', 'barstacked', 'step', 'stepfilled'}, default: 'bar'
64136410
The type of histogram to draw.
64146411
64156412
- 'bar' is a traditional bar-type histogram. If multiple data
@@ -6419,45 +6416,39 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
64196416
- 'step' generates a lineplot that is by default unfilled.
64206417
- 'stepfilled' generates a lineplot that is by default filled.
64216418
6422-
Default is 'bar'
6423-
6424-
align : {'left', 'mid', 'right'}, optional, default 'mid'
6419+
align : {'left', 'mid', 'right'}, default: 'mid'
64256420
The horizontal alignment of the histogram bars.
64266421
64276422
- 'left': bars are centered on the left bin edges.
64286423
- 'mid': bars are centered between the bin edges.
64296424
- 'right': bars are centered on the right bin edges.
64306425
6426+
orientation : {'vertical', 'horizontal'}, default: 'vertical'
6427+
If 'horizontal', `~.Axes.barh` will be used for bar-type histograms
6428+
and the *bottom* kwarg will be the left edges.
64316429
6432-
orientation : {'horizontal', 'vertical'}, optional
6433-
If 'horizontal', `~matplotlib.pyplot.barh` will be used for
6434-
bar-type histograms and the *bottom* kwarg will be the left edges.
6435-
6436-
rwidth : scalar or None, optional, default: None
6430+
rwidth : scalar or None, default: None
64376431
The relative width of the bars as a fraction of the bin width. If
64386432
``None``, automatically compute the width.
64396433
64406434
Ignored if *histtype* is 'step' or 'stepfilled'.
64416435
6442-
6443-
log : bool, optional, default: False
6436+
log : bool, default: False
64446437
If ``True``, the histogram axis will be set to a log scale. If
64456438
*log* is ``True`` and *x* is a 1D array, empty bins will be
64466439
filtered out and only the non-empty ``(n, bins, patches)``
64476440
will be returned.
64486441
6449-
color : color or array-like of colors or None, optional, default: None
6442+
color : color or array-like of colors or None, default: None
64506443
Color or sequence of colors, one per dataset. Default (``None``)
64516444
uses the standard line color sequence.
64526445
6453-
Default is ``None``
6454-
6455-
label : str or None, optional, default: None
6446+
label : str or None, default: None
64566447
String, or sequence of strings to match multiple datasets. Bar
64576448
charts yield multiple patches per dataset, but only the first gets
64586449
the label, so that the legend command will work as expected.
64596450
6460-
stacked : bool, optional, default:False
6451+
stacked : bool, default: False
64616452
If ``True``, multiple data are stacked on top of each other If
64626453
``False`` multiple data are arranged side by side if histtype is
64636454
'bar' or on top of each other if histtype is 'step'

0 commit comments

Comments
 (0)