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

Commitc7c5ade

Browse files
Refactor grouped_bar orientation logic using shared common_kwargs
1 parent9fffd16 commitc7c5ade

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎lib/matplotlib/axes/_axes.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,12 +3379,16 @@ def grouped_bar(self, heights, *, positions=None, group_spacing=1.5, bar_spacing
33793379
):
33803380
lefts= (group_centers-0.5*group_distance+margin_abs
33813381
+i* (bar_width+bar_spacing_abs))
3382+
common_kwargs=dict(
3383+
align="edge",
3384+
label=label,
3385+
color=color,
3386+
hatch=hatch_pattern
3387+
)
33823388
iforientation=="vertical":
3383-
bc=self.bar(lefts,hs,width=bar_width,align="edge",
3384-
label=label,color=color,hatch=hatch_pattern,**kwargs)
3389+
bc=self.bar(lefts,hs,width=bar_width,**common_kwargs,**kwargs)
33853390
else:
3386-
bc=self.barh(lefts,hs,height=bar_width,align="edge",
3387-
label=label,color=color,hatch=hatch_pattern,**kwargs)
3391+
bc=self.barh(lefts,hs,height=bar_width,**common_kwargs,**kwargs)
33883392
bar_containers.append(bc)
33893393

33903394
iftick_labelsisnotNone:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp