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

Commitbb7655b

Browse files
authored
Merge pull request#30057 from QuLogic/auto-backport-of-pr-29895-on-v3.10.x
Backport PR#29895 on branch v3.10.x (The 'lines.markeredgecolor' now doesn't interfere on the color of errorbar caps)"
2 parentsd397c52 +6ea55ca commitbb7655b

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

‎lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3780,7 +3780,7 @@ def _upcast_err(err):
37803780
'zorder','rasterized'):
37813781
ifkeyinkwargs:
37823782
eb_cap_style[key]=kwargs[key]
3783-
eb_cap_style['color']=ecolor
3783+
eb_cap_style["markeredgecolor"]=ecolor
37843784

37853785
barcols= []
37863786
caplines= {'x': [],'y': []}

‎lib/matplotlib/tests/test_axes.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9618,3 +9618,29 @@ def test_axes_set_position_external_bbox_unchanged(fig_test, fig_ref):
96189618
ax_test.set_position([0.25,0.25,0.5,0.5])
96199619
assert (bbox.x0,bbox.y0,bbox.width,bbox.height)== (0.0,0.0,1.0,1.0)
96209620
ax_ref=fig_ref.add_axes([0.25,0.25,0.5,0.5])
9621+
9622+
9623+
deftest_caps_color():
9624+
# Creates a simple plot with error bars and a specified ecolor
9625+
x=np.linspace(0,10,10)
9626+
mpl.rcParams['lines.markeredgecolor']='green'
9627+
ecolor='red'
9628+
9629+
fig,ax=plt.subplots()
9630+
errorbars=ax.errorbar(x,np.sin(x),yerr=0.1,ecolor=ecolor)
9631+
9632+
# Tests if the caps have the specified color
9633+
forcapinerrorbars[2]:
9634+
assertmcolors.same_color(cap.get_edgecolor(),ecolor)
9635+
9636+
9637+
deftest_caps_no_ecolor():
9638+
# Creates a simple plot with error bars without specifying ecolor
9639+
x=np.linspace(0,10,10)
9640+
mpl.rcParams['lines.markeredgecolor']='green'
9641+
fig,ax=plt.subplots()
9642+
errorbars=ax.errorbar(x,np.sin(x),yerr=0.1)
9643+
9644+
# Tests if the caps have the default color (blue)
9645+
forcapinerrorbars[2]:
9646+
assertmcolors.same_color(cap.get_edgecolor(),"blue")

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp