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

Skip to content

Commit 8e2fe9b

Browse files
authored
Merge pull request #16446 from anntzer/macho
TST: Replace matshow baseline test by check_figures_equal.
2 parents af2bc5e + f5afbdf commit 8e2fe9b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
Binary file not shown.

lib/matplotlib/tests/test_axes.py

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

149149

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

158160

159161
@image_comparison(['formatter_ticker_001',

0 commit comments

Comments
 (0)