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