Skip to content

Commit

Permalink
add test_stackplot in test_datetime.py (#27114)
Browse files Browse the repository at this point in the history
* add test_stackplot in test_datetime.py

* Remove stackplot test with datetime y-axis

* Refactor test_stackplot
  • Loading branch information
QuadroTec committed Oct 18, 2023
1 parent b617bf5 commit 1d1171f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/matplotlib/tests/test_datetime.py
Expand Up @@ -325,11 +325,15 @@ def test_spy(self):
fig, ax = plt.subplots()
ax.spy(...)

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

fig, ax = plt.subplots(layout='constrained')
ax.stackplot(dates, stacked_nums)

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

0 comments on commit 1d1171f

Please sign in to comment.