8000 Add zorder test · matplotlib/matplotlib@31c286b · GitHub
[go: up one dir, main page]

Skip to content

Commit 31c286b

Browse files
committed
Add zorder test
1 parent 4126368 commit 31c286b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6329,3 +6329,18 @@ def test_hist_range_and_density():
63296329
range=(0, 1), density=True)
63306330
assert bins[0] == 0
63316331
assert bins[-1] == 1
6332+
6333+
6334+
def test_bar_errbar_zorder():
6335+
# Check that the zorder of errorbars is always greater than the bar they
6336+
# are plotted on
6337+
fig, ax = plt.subplots()
6338+
x = [1, 2, 3]
6339+
barcont = ax.bar(x=x, height=x, yerr=x, capsize=5, zorder=3)
6340+
6341+
data_line, caplines, barlinecols = barcont.errorbar.lines
6342+
for bar in barcont.patches:
6343+
for capline in caplines:
6344+
assert capline.zorder > bar.zorder
6345+
for barlinecol in barlinecols:
6346+
assert barlinecol.zorder > bar.zorder

0 commit comments

Comments
 (0)
0