Skip to content

Commit 9f2e75d

Browse files
committed
test: implement stacked bar regression test
Replace the skipped test_bar_stack() placeholder with a real regression test that verifies both bar and area stacking behavior across a 2x2 subplot grid (stacked vs unstacked for each type). Fixes #642
1 parent 6d700a9 commit 9f2e75d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ultraplot/tests/test_1dplots.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,19 @@ def test_column_iteration(rng):
116116
return fig
117117

118118

119-
@pytest.mark.skip("TODO")
120119
@pytest.mark.mpl_image_compare
121-
def test_bar_stack():
120+
def test_bar_stack(rng):
122121
"""
123122
Test bar and area stacking.
124123
"""
125-
# TODO: Add test here
124+
fig, axs = uplt.subplots(ncols=2, nrows=2)
125+
x = np.arange(5)
126+
y = rng.random((5, 3))
127+
axs[0].bar(x, y, stack=False)
128+
axs[1].bar(x, y, stack=True)
129+
axs[2].area(x, y, stack=False)
130+
axs[3].area(x, y, stack=True)
131+
return fig
126132

127133

128134
@pytest.mark.mpl_image_compare

0 commit comments

Comments
 (0)