Skip to content

Commit 3146413

Browse files
committed
Merge pull request #2819 from phobson/boxplot-doc
DOC: clarified docstring for cbook.boxplot_stats
2 parents b04c8f5 + bdba773 commit 3146413

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

lib/matplotlib/cbook.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -1883,16 +1883,34 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None):
18831883
Returns
18841884
-------
18851885
bxpstats : A list of dictionaries containing the results for each column
1886-
of data. Keys are as
1886+
of data. Keys of each dictionary are the following:
1887+
1888+
======== ===================================
1889+
Key Value Description
1890+
======== ===================================
1891+
label tick label for the boxplot
1892+
mean arithemetic mean value
1893+
median 50th percentile
1894+
q1 first quartile (25th percentile)
1895+
q3 third quartile (75th percentile)
1896+
cilo lower notch around the median
1897+
ciho upper notch around the median
1898+
whislo end of the lower whisker
1899+
whishi end of the upper whisker
1900+
fliers outliers
1901+
======== ===================================
18871902
18881903
Notes
18891904
-----
18901905
Non-bootstrapping approach to confidence interval uses Gaussian-based
1891-
asymptotic approximation.
1906+
asymptotic approximation:
1907+
1908+
.. math:: \mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}
18921909
18931910
General approach from:
18941911
McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
18951912
Boxplots", The American Statistician, 32:12-16.
1913+
18961914
'''
18971915

18981916
def _bootstrap_median(data, N=5000):

0 commit comments

Comments
 (0)