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

Appearance settings

Commit 1d1171f

Browse filesBrowse 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
Copy full SHA for 1d1171f

File tree

1 file changed

+7
-3
lines changed
Filter options

1 file changed

+7
-3
lines changed

‎lib/matplotlib/tests/test_datetime.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_datetime.py
+7-3Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.