Skip to content

Commit 919a6cb

Browse files
committed
Add unit test for nonuniform logscale
1 parent c91bf41 commit 919a6cb

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.subplots(ncols=3, nrows=1)
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, 16)
1419+
ax.set_ylim(1, 16)
1420+
ax.set_box_aspect(1)
1421+
if i == 1:
1422+
ax.set_xscale("log", base=2)
1423+
ax.set_yscale("log", base=2)
1424+
if i == 2:
1425+
ax.set_xscale("log", base=4)
1426+
ax.set_yscale("log", base=4)
1427+
ax.add_image(im)
1428+
1429+
14091430
@image_comparison(
14101431
['rgba_antialias.png'], style='mpl20', remove_text=True,
14111432
tol=0 if platform.machine() == 'x86_64' else 0.007)

0 commit comments

Comments
 (0)