Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita9a1abf

Browse files
committed
use setdefault method
1 parentf49904c commita9a1abf

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4319,14 +4319,17 @@ def do_patch(xs, ys, **kwargs):
43194319
do_box=do_patchifpatch_artistelsedo_plot
43204320
boxes.append(do_box(box_x,box_y,**box_kw))
43214321
# draw the whiskers
4322-
whiskers.append(do_plot(whis_x,whislo_y,**whisker_kw,label="_nolegend_"))
4323-
whiskers.append(do_plot(whis_x,whishi_y,**whisker_kw,label="_nolegend_"))
4322+
whisker_kw.setdefault('label','_nolegend_')
4323+
whiskers.append(do_plot(whis_x,whislo_y,**whisker_kw))
4324+
whiskers.append(do_plot(whis_x,whishi_y,**whisker_kw))
43244325
# maybe draw the caps
43254326
ifshowcaps:
4326-
caps.append(do_plot(cap_x,cap_lo,**cap_kw,label="_nolegend_"))
4327-
caps.append(do_plot(cap_x,cap_hi,**cap_kw,label="_nolegend_"))
4327+
cap_kw.setdefault('label','_nolegend_')
4328+
caps.append(do_plot(cap_x,cap_lo,**cap_kw))
4329+
caps.append(do_plot(cap_x,cap_hi,**cap_kw))
43284330
# draw the medians
4329-
medians.append(do_plot(med_x,med_y,**median_kw,label="_nolegend_"))
4331+
median_kw.setdefault('label','_nolegend_')
4332+
medians.append(do_plot(med_x,med_y,**median_kw))
43304333
# maybe draw the means
43314334
ifshowmeans:
43324335
ifmeanline:
@@ -4338,9 +4341,10 @@ def do_patch(xs, ys, **kwargs):
43384341
means.append(do_plot([pos], [stats['mean']],**mean_kw))
43394342
# maybe draw the fliers
43404343
ifshowfliers:
4344+
flier_kw.setdefault('label','_nolegend_')
43414345
flier_x=np.full(len(stats['fliers']),pos,dtype=np.float64)
43424346
flier_y=stats['fliers']
4343-
fliers.append(do_plot(flier_x,flier_y,**flier_kw,label="_nolegend_"))
4347+
fliers.append(do_plot(flier_x,flier_y,**flier_kw))
43444348

43454349
ifmanage_ticks:
43464350
axis_name="x"ifvertelse"y"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp