Skip to content

Commit 3c581ad

Browse files
committed
Add test for NonUniformImage with nonlinear scale
1 parent daa7b1d commit 3c581ad

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

lib/matplotlib/tests/test_image.py

+21
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,27 @@ def test_nonuniform_and_pcolor():
14061406
ax.set(xlim=(0, 10))
14071407

14081408

1409+
@image_comparison(["nonuniform_logscale.png"], style="mpl20")
1410+
def test_nonuniform_logscale():
1411+
axs = plt.figure(figsize=(3, 3)).subplots(3)
1412+
1413+
for i in range(3):
1414+
ax = axs[i]
1415+
im = NonUniformImage(ax)
1416+
im.set_data(np.arange(1, 4) ** 2, np.arange(1, 4) ** 2,
1417+
np.arange(9).reshape((3, 3)))
1418+
ax.set_xlim(1, 9)
1419+
ax.set_ylim(1, 9)
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)
1427+
ax.add_image(im)
1428+
1429+
14091430
@image_comparison(
14101431
['rgba_antialias.png'], style='mpl20', remove_text=True,
14111432
tol=0.007 if platform.machine() in ('aarch64', 'ppc64le', 's390x') else 0)

0 commit comments

Comments
 (0)