From 24a1607bb91b64798cb5db964fff954dd29dab42 Mon Sep 17 00:00:00 2001 From: Behram Mistree Date: Sat, 27 Sep 2014 00:31:04 -0700 Subject: [PATCH] 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. --- lib/matplotlib/axes/_axes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 7301c2c93157..3a6c8d81f986 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -3048,6 +3048,10 @@ def boxplot(self, x, notch=False, sym='b+', vert=True, whis=1.5, else: flierprops['sym'] = sym + # do not show fliers if sym is empty string + if sym == '': + showfliers = False + # replace medians if necessary: if usermedians is not None: if (len(np.ravel(usermedians)) != len(bxpstats) or