Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa6be74

Browse files
authored
Merge pull request #27476 from ConstableCatnip/imshow_datetime_test
Added smoke test for Axes.imshow to test_datetime.py
2 parents 5ee79b7 + e0f5b23 commit fa6be74

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,15 @@ def test_hlines(self):
569569
xmin=0.45,
570570
xmax=0.65)
571571

572-
@pytest.mark.xfail(reason="Test for imshow not written yet")
573572
@mpl.style.context("default")
574573
def test_imshow(self):
575574
fig, ax = plt.subplots()
576-
ax.imshow(...)
575+
a = np.diag(range(5))
576+
dt_start = datetime.datetime(2010, 11, 1)
577+
dt_end = datetime.datetime(2010, 11, 11)
578+
extent = (dt_start, dt_end, dt_start, dt_end)
579+
ax.imshow(a, extent=extent)
580+
ax.tick_params(axis="x", labelrotation=90)
577581

578582
@pytest.mark.xfail(reason="Test for loglog not written yet")
579583
@mpl.style.context("default")

0 commit comments

Comments
 (0)