8000 add test_stackplot in test_datetime.py (#27114) · matplotlib/matplotlib@1d1171f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1d1171f

Browse files
authored
add test_stackplot in test_datetime.py (#27114)
* add test_stackplot in test_datetime.py * Remove stackplot test with datetime y-axis * Refactor test_stackplot
1 parent b617bf5 commit 1d1171f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,15 @@ def test_spy(self):
325325
fig, ax = plt.subplots()
326326
ax.spy(...)
327327

328-
@pytest.mark.xfail(reason="Test for stackplot not written yet")
329328
@mpl.style.context("default")
330329
def test_stackplot(self):
331-
fig, ax = plt.subplots()
332-
ax.stackplot(...)
330+
mpl.rcParams["date.converter"] = 'concise'
331+
N = 10
332+
stacked_nums = np.tile(np.arange(1, N), (4, 1))
333+
dates = np.array([datetime.datetime(2020 + i, 1, 1) for i in range(N - 1)])
334+
335+
fig, ax = plt.subplots(layout='constrained')
336+
ax.stackplot(dates, stacked_nums)
333337

334338
@pytest.mark.xfail(reason="Test for stairs not written yet")
335339
@mpl.style.context("default")

0 commit comments

Comments
 (0)
0