Skip to content

Commit a2a2809

Browse files
Added smoke test for Axes.matshow to test_datetime.py (#27474)
1 parent 8fa89d6 commit a2a2809

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/matplotlib/tests/test_datetime.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,16 @@ def test_loglog(self):
542542
fig, ax = plt.subplots()
543543
ax.loglog(...)
544544

545-
@pytest.mark.xfail(reason="Test for matshow not written yet")
546545
@mpl.style.context("default")
547546
def test_matshow(self):
547+
a = np.diag(range(5))
548+
dt_start = datetime.datetime(1980, 4, 15)
549+
dt_end = datetime.datetime(2020, 11, 11)
550+
extent = (dt_start, dt_end, dt_start, dt_end)
548551
fig, ax = plt.subplots()
549-
ax.matshow(...)
552+
ax.matshow(a, extent=extent)
553+
for label in ax.get_xticklabels():
554+
label.set_rotation(90)
550555

551556
@pytest.mark.xfail(reason="Test for pcolor not written yet")
552557
@mpl.style.context("default")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy