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

Skip to content

Commit 25f934e

Browse files
bmistreetacaswell
authored andcommitted
Previous matplotlib had a bug. As per documentation, specifying empty
string for sym argument should prevent drawing fliers for boxplots. As an example, the following script displays fliers in the boxplot when it shouldn't. import matplotlib.pyplot as plt data = list(range(0,100)) + [200,-200,250,-250] bp = plt.boxplot(data,sym='',widths=.3) plt.show() Added logic to ensure empty sym string does not display fliers.
1 parent 07fbef1 commit 25f934e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3081,6 +3081,10 @@ def boxplot(self, x, notch=False, sym=None, vert=True, whis=1.5,
30813081
flierprops['markeredgecolor'] = color
30823082
flierprops['markerfacecolor'] = color
30833083

3084+
# do not show fliers if sym is empty string
3085+
if sym == '':
3086+
showfliers = False
3087+
30843088
# replace medians if necessary:
30853089
if usermedians is not None:
30863090
if (len(np.ravel(usermedians)) != len(bxpstats) or

0 commit comments

Comments
 (0)