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

Skip to content

Commit ec55244

Browse files
committed
Change test for nonlinear NonUniformImage
1 parent 855d128 commit ec55244

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

lib/matplotlib/tests/test_image.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,20 +1408,24 @@ def test_nonuniform_and_pcolor():
14081408

14091409
@image_comparison(["nonuniform_logscale.png"], style="mpl20")
14101410
def test_nonuniform_logscale():
1411-
fig, axs = plt.subplots(2)
1411+
_, axs = plt.subplots(3)
14121412

1413-
for ax, scale in zip(axs, ["linear", "log"]):
1413+
for i in range(3):
1414+
ax = axs[i]
14141415
im = NonUniformImage(ax)
1415-
im.set_data([1, 10], [1, 10], np.array([[0, 255], [255, 0]], dtype=np.uint8))
1416-
1417-
ax.set_xscale(scale)
1418-
ax.set_yscale(scale)
1416+
im.set_data(np.arange(1, 4) ** 2, np.arange(1, 4) ** 2,
1417+
np.arange(9).reshape((3, 3)))
14191418
ax.set_xlim(1, 10)
14201419
ax.set_ylim(1, 10)
1420+
ax.set_axis_off()
1421+
if i == 1:
1422+
ax.set_xscale("log")
1423+
ax.set_yscale("log")
1424+
if i == 2:
1425+
ax.set_xscale("log", base=2)
1426+
ax.set_yscale("log", base=3)
14211427
ax.add_image(im)
14221428

1423-
ax.add_image(im)
1424-
14251429

14261430
@image_comparison(
14271431
['rgba_antialias.png'], style='mpl20', remove_text=True,

0 commit comments

Comments
 (0)