Skip to content

Commit d9677e9

Browse files
committed
DOC: update cbook docstring with new autoremove option
1 parent 0fc2da8 commit d9677e9

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

lib/matplotlib/cbook.py

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1870,37 +1870,39 @@ def delete_masked_points(*args):
18701870
def boxplot_stats(X, whis=1.5, autorange=False, bootstrap=None,
18711871
labels=None):
18721872
"""
1873-
Returns list of dictionaries of staticists to be use to draw a
1874-
series of box and whisker plots. See the `Returns` section below to
1875-
the required keys of the dictionary. Users can skip this function
1876-
and pass a user-defined set of dictionaries to the new `axes.bxp`
1877-
method instead of relying on MPL to do the calcs.
1873+
Returns list of dictionaries of statistics used to draw a series
1874+
of box and whisker plots. See the `Returns` section below to the
1875+
required keys of the dictionary. Users can skip this function and
1876+
pass a user-defined set of dictionaries to the new `axes.bxp` method
1877+
instead of relying on MPL to do the calculations.
18781878
18791879
Parameters
18801880
----------
18811881
X : array-like
1882-
Data that will be represented in the boxplots. Should have 2 or fewer
1883-
dimensions.
1884-
1882+
Data that will be represented in the boxplots. Should have 2 or
1883+
fewer dimensions.
18851884
whis : float, string, or sequence (default = 1.5)
1886-
As a float, determines the reach of the whiskers past the first and
1887-
third quartiles (e.g., Q3 + whis*IQR, QR = interquartile range, Q3-Q1).
1888-
Beyond the whiskers, data are considered outliers and are plotted as
1889-
individual points. Set this to an unreasonably high value to force the
1890-
whiskers to show the min and max data. Alternatively, set this to an
1891-
ascending sequence of percentile (e.g., [5, 95]) to set the whiskers
1892-
at specific percentiles of the data. Finally, can `whis` be the
1893-
string 'range' to force the whiskers to the min and max of the data.
1894-
In the edge case that the 25th and 75th percentiles are equivalent,
1895-
`whis` will be automatically set to 'range'
1896-
1897-
bootstrap : int or None (default)
1898-
Number of times the confidence intervals around the median should
1899-
be bootstrapped (percentile method).
1900-
1901-
labels : sequence
1902-
Labels for each dataset. Length must be compatible with dimensions
1903-
of `X`
1885+
As a float, determines the reach of the whiskers past the first
1886+
and third quartiles (e.g., Q3 + whis*IQR, QR = interquartile
1887+
range, Q3-Q1). Beyond the whiskers, data are considered outliers
1888+
and are plotted as individual points. This can be set this to an
1889+
ascending sequence of percentile (e.g., [5, 95]) to set the
1890+
whiskers at specific percentiles of the data. Finally, `whis`
1891+
can be the string ``'range'`` to force the whiskers to the
1892+
minimum and maximum of the data. In the edge case that the 25th
1893+
and 75th percentiles are equivalent, `whis` can be automatically
1894+
set to ``'range'`` via the `autorange` option.
1895+
autorange : bool, optional (False)
1896+
When `True` and the data are distributed such that the 25th and
1897+
75th percentiles are equal, ``whis`` is set to ``'range'`` such
1898+
that the whisker ends are at the minimum and maximum of the
1899+
data.
1900+
bootstrap : int, optional
1901+
Number of times the confidence intervals around the median
1902+
should be bootstrapped (percentile method).
1903+
labels : array-like, optional
1904+
Labels for each dataset. Length must be compatible with
1905+
dimensions of `X`.
19041906
19051907
Returns
19061908
-------
@@ -1925,8 +1927,8 @@ def boxplot_stats(X, whis=1.5, autorange=False, bootstrap=None,
19251927
19261928
Notes
19271929
-----
1928-
Non-bootstrapping approach to confidence interval uses Gaussian-based
1929-
asymptotic approximation:
1930+
Non-bootstrapping approach to confidence interval uses Gaussian-
1931+
based asymptotic approximation:
19301932
19311933
.. math::
19321934
@@ -1936,7 +1938,7 @@ def boxplot_stats(X, whis=1.5, autorange=False, bootstrap=None,
19361938
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
19371939
Boxplots", The American Statistician, 32:12-16.
19381940
1939-
'''
1941+
"""
19401942

19411943
def _bootstrap_median(data, N=5000):
19421944
# determine 95% confidence intervals of the median

0 commit comments

Comments
 (0)