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

Skip to content

Commit c92a99b

Browse files
committed
Add zorder test
1 parent f8f8ad1 commit c92a99b

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
@@ -6314,3 +6314,18 @@ def test_hist_range_and_density():
63146314
range=(0, 1), density=True)
63156315
assert bins[0] == 0
63166316
assert bins[-1] == 1
6317+
6318+
6319+
def test_bar_errbar_zorder():
6320+
# Check that the zorder of errorbars is always greater than the bar they
6321+
# are plotted on
6322+
fig, ax = plt.subplots()
6323+
x = [1, 2, 3]
6324+
barcont = ax.bar(x=x, height=x, yerr=x, capsize=5, zorder=3)
6325+
6326+
data_line, caplines, barlinecols = barcont.errorbar.lines
6327+
for bar in barcont.patches:
6328+
for capline in caplines:
6329+
assert capline.zorder > bar.zorder
6330+
for barlinecol in barlinecols:
6331+
assert barlinecol.zorder > bar.zorder

0 commit comments

Comments
 (0)
0