@@ -4004,6 +4004,9 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
40044004 if 'color' in boxprops :
40054005 boxprops ['edgecolor' ] = boxprops .pop ('color' )
40064006
4007+ if labels :
4008+ boxprops ['label' ] = labels
4009+
40074010 # if non-default sym value, put it into the flier dictionary
40084011 # the logic for providing the default symbol ('b+') now lives
40094012 # in bxp in the initial value of flierkw
@@ -4316,13 +4319,16 @@ def do_patch(xs, ys, **kwargs):
43164319 do_box = do_patch if patch_artist else do_plot
43174320 boxes .append (do_box (box_x , box_y , ** box_kw ))
43184321 # draw the whiskers
4322+ whisker_kw .setdefault ('label' , '_nolegend_' )
43194323 whiskers .append (do_plot (whis_x , whislo_y , ** whisker_kw ))
43204324 whiskers .append (do_plot (whis_x , whishi_y , ** whisker_kw ))
43214325 # maybe draw the caps
43224326 if showcaps :
4327+ cap_kw .setdefault ('label' , '_nolegend_' )
43234328 caps .append (do_plot (cap_x , cap_lo , ** cap_kw ))
43244329 caps .append (do_plot (cap_x , cap_hi , ** cap_kw ))
43254330 # draw the medians
4331+ median_kw .setdefault ('label' , '_nolegend_' )
43264332 medians .append (do_plot (med_x , med_y , ** median_kw ))
43274333 # maybe draw the means
43284334 if showmeans :
@@ -4335,6 +4341,7 @@ def do_patch(xs, ys, **kwargs):
43354341 means .append (do_plot ([pos ], [stats ['mean' ]], ** mean_kw ))
43364342 # maybe draw the fliers
43374343 if showfliers :
4344+ flier_kw .setdefault ('label' , '_nolegend_' )
43384345 flier_x = np .full (len (stats ['fliers' ]), pos , dtype = np .float64 )
43394346 flier_y = stats ['fliers' ]
43404347 fliers .append (do_plot (flier_x , flier_y , ** flier_kw ))
0 commit comments