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

Skip to content

Commit f5afbdf

Browse files
committed
Replace matshow baseline test by check_figures_equal.
1 parent 53c8d6a commit f5afbdf

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

-14.6 KB
Binary file not shown.

lib/matplotlib/tests/test_axes.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,15 @@ def test_spy_invalid_kwargs():
144144
ax.spy(np.eye(3, 3), **unsupported_kw)
145145

146146

147-
@image_comparison(['matshow.png'], style='mpl20')
148-
def test_matshow():
149-
np.random.seed(19680801)
147+
@check_figures_equal(extensions=["png"])
148+
def test_matshow(fig_test, fig_ref):
149+
mpl.style.use("mpl20")
150150
a = np.random.rand(32, 32)
151-
152-
fig, ax = plt.subplots()
153-
ax.matshow(a)
151+
fig_test.add_subplot().matshow(a)
152+
ax_ref = fig_ref.add_subplot()
153+
ax_ref.imshow(a)
154+
ax_ref.xaxis.tick_top()
155+
ax_ref.xaxis.set_ticks_position('both')
154156

155157

156158
@image_comparison(['formatter_ticker_001',

0 commit comments

Comments
 (0)