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

Skip to content

Commit 4d390fa

Browse files
authored
Merge pull request #7753 from Carreau/improve-whiskers-docstrings
Clarify the uses of whiskers float parameter.
2 parents d7879bc + 97609a8 commit 4d390fa

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lib/matplotlib/axes/_axes.py

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

lib/matplotlib/cbook.py

Lines 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)