Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 97609a8

Browse filesBrowse files
committed
Clarify the uses of whiskers float parameter.
It is not clear (at least to a couple of non-native English speakers) that the whiskers extend to the last data point. More precisely: > "If it's 1.5 times Q3-Q1 it should be symmetric" The code does seem to limit the whisker to the last data point, and that correspond to one of the usage of whiskers described by Wikipedia. So fix docstrings.
1 parent 1fa4dd7 commit 97609a8
Copy full SHA for 97609a8

File tree

Expand file treeCollapse file tree

2 files changed

+12
-6
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-6
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3126,9 +3126,12 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
31263126
everything is drawn horizontally.
31273127
31283128
whis : float, sequence, or string (default = 1.5)
3129-
As a float, determines the reach of the whiskers past the
3130-
first and third quartiles (e.g., Q3 + whis*IQR,
3131-
IQR = interquartile range, Q3-Q1). Beyond the whiskers, data
3129+
As a float, determines the reach of the whiskers to the beyond the
3130+
first and third quartiles. In other words, where IQR is the
3131+
interquartile range (`Q3-Q1`), the upper whisker will extend to
3132+
last datum less than `Q3 + whis*IQR`). Similarly, the lower whisker
3133+
will extend to the first datum greater than `Q1 - whis*IQR`.
3134+
Beyond the whiskers, data
31323135
are considered outliers and are plotted as individual
31333136
points. Set this to an unreasonably high value to force the
31343137
whiskers to show the min and max values. Alternatively, set

‎lib/matplotlib/cbook.py

Copy file name to clipboardExpand all lines: lib/matplotlib/cbook.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,9 +1872,12 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
18721872
fewer dimensions.
18731873
18741874
whis : float, string, or sequence (default = 1.5)
1875-
As a float, determines the reach of the whiskers past the first
1876-
and third quartiles (e.g., Q3 + whis*IQR, QR = interquartile
1877-
range, Q3-Q1). Beyond the whiskers, data are considered outliers
1875+
As a float, determines the reach of the whiskers to the beyond the
1876+
first and third quartiles. In other words, where IQR is the
1877+
interquartile range (`Q3-Q1`), the upper whisker will extend to last
1878+
datum less than `Q3 + whis*IQR`). Similarly, the lower whisker will
1879+
extend to the first datum greater than `Q1 - whis*IQR`.
1880+
Beyond the whiskers, data are considered outliers
18781881
and are plotted as individual points. This can be set this to an
18791882
ascending sequence of percentile (e.g., [5, 95]) to set the
18801883
whiskers at specific percentiles of the data. Finally, `whis`

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.