@@ -4004,6 +4004,9 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
4004
4004
if 'color' in boxprops :
4005
4005
boxprops ['edgecolor' ] = boxprops .pop ('color' )
4006
4006
4007
+ if labels :
4008
+ boxprops ['label' ] = labels
4009
+
4007
4010
# if non-default sym value, put it into the flier dictionary
4008
4011
# the logic for providing the default symbol ('b+') now lives
4009
4012
# in bxp in the initial value of flierkw
@@ -4316,13 +4319,16 @@ def do_patch(xs, ys, **kwargs):
4316
4319
do_box = do_patch if patch_artist else do_plot
4317
4320
boxes .append (do_box (box_x , box_y , ** box_kw ))
4318
4321
# draw the whiskers
4322
+ whisker_kw .setdefault ('label' , '_nolegend_' )
4319
4323
whiskers .append (do_plot (whis_x , whislo_y , ** whisker_kw ))
4320
4324
whiskers .append (do_plot (whis_x , whishi_y , ** whisker_kw ))
4321
4325
# maybe draw the caps
4322
4326
if showcaps :
4327
+ cap_kw .setdefault ('label' , '_nolegend_' )
4323
4328
caps .append (do_plot (cap_x , cap_lo , ** cap_kw ))
4324
4329
caps .append (do_plot (cap_x , cap_hi , ** cap_kw ))
4325
4330
# draw the medians
4331
+ median_kw .setdefault ('label' , '_nolegend_' )
4326
4332
medians .append (do_plot (med_x , med_y , ** median_kw ))
4327
4333
# maybe draw the means
4328
4334
if showmeans :
@@ -4335,6 +4341,7 @@ def do_patch(xs, ys, **kwargs):
4335
4341
means .append (do_plot ([pos ], [stats ['mean' ]], ** mean_kw ))
4336
4342
# maybe draw the fliers
4337
4343
if showfliers :
4344
+ flier_kw .setdefault ('label' , '_nolegend_' )
4338
4345
flier_x = np .full (len (stats ['fliers' ]), pos , dtype = np .float64 )
4339
4346
flier_y = stats ['fliers' ]
4340
4347
fliers .append (do_plot (flier_x , flier_y , ** flier_kw ))
0 commit comments