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

Backport PR #29895 on branch v3.10.x (The 'lines.markeredgecolor' now doesn't interfere on the color of errorbar caps)"#30057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionlib/matplotlib/axes/_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3780,7 +3780,7 @@ def _upcast_err(err):
'zorder', 'rasterized'):
if key in kwargs:
eb_cap_style[key] = kwargs[key]
eb_cap_style['color'] = ecolor
eb_cap_style["markeredgecolor"] = ecolor

barcols = []
caplines = {'x': [], 'y': []}
Expand Down
26 changes: 26 additions & 0 deletionslib/matplotlib/tests/test_axes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9618,3 +9618,29 @@ def test_axes_set_position_external_bbox_unchanged(fig_test, fig_ref):
ax_test.set_position([0.25, 0.25, 0.5, 0.5])
assert (bbox.x0, bbox.y0, bbox.width, bbox.height) == (0.0, 0.0, 1.0, 1.0)
ax_ref = fig_ref.add_axes([0.25, 0.25, 0.5, 0.5])


def test_caps_color():
# Creates a simple plot with error bars and a specified ecolor
x = np.linspace(0, 10, 10)
mpl.rcParams['lines.markeredgecolor'] = 'green'
ecolor = 'red'

fig, ax = plt.subplots()
errorbars = ax.errorbar(x, np.sin(x), yerr=0.1, ecolor=ecolor)

# Tests if the caps have the specified color
for cap in errorbars[2]:
assert mcolors.same_color(cap.get_edgecolor(), ecolor)


def test_caps_no_ecolor():
# Creates a simple plot with error bars without specifying ecolor
x = np.linspace(0, 10, 10)
mpl.rcParams['lines.markeredgecolor'] = 'green'
fig, ax = plt.subplots()
errorbars = ax.errorbar(x, np.sin(x), yerr=0.1)

# Tests if the caps have the default color (blue)
for cap in errorbars[2]:
assert mcolors.same_color(cap.get_edgecolor(), "blue")
Loading

[8]ページ先頭

©2009-2025 Movatter.jp