From c91bf41def4a6677ae878cc01c0e9d5bc3d62f70 Mon Sep 17 00:00:00 2001 From: trananso Date: Fri, 22 Mar 2024 13:12:14 -0400 Subject: [PATCH 1/2] Fix NonUniformImage with nonlinear scale --- lib/matplotlib/image.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 5b0152505397..43b8c007a867 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1085,12 +1085,16 @@ def make_image(self, renderer, magnification=1.0, unsampled=False): B[:, :, 0:3] = A B[:, :, 3] = 255 A = B - vl = self.axes.viewLim l, b, r, t = self.axes.bbox.extents width = int(((round(r) + 0.5) - (round(l) - 0.5)) * magnification) height = int(((round(t) + 0.5) - (round(b) - 0.5)) * magnification) - x_pix = np.linspace(vl.x0, vl.x1, width) - y_pix = np.linspace(vl.y0, vl.y1, height) + + invertedTransform = self.axes.transData.inverted() + x_pix = invertedTransform.transform( + [(x, b) for x in np.linspace(l, r, width)])[:, 0] + y_pix = invertedTransform.transform( + [(l, y) for y in np.linspace(b, t, height)])[:, 1] + if self._interpolation == "nearest": x_mid = (self._Ax[:-1] + self._Ax[1:]) / 2 y_mid = (self._Ay[:-1] + self._Ay[1:]) / 2 From 919a6cbade66227ff7e529f3d6147e7f1c48e42b Mon Sep 17 00:00:00 2001 From: trananso Date: Mon, 15 Apr 2024 10:12:16 -0400 Subject: [PATCH 2/2] Add unit test for nonuniform logscale --- .../test_image/nonuniform_and_pcolor.png | Bin 3431 -> 4223 bytes .../test_image/nonuniform_logscale.png | Bin 0 -> 10262 bytes lib/matplotlib/tests/test_image.py | 21 ++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 lib/matplotlib/tests/baseline_images/test_image/nonuniform_logscale.png diff --git a/lib/matplotlib/tests/baseline_images/test_image/nonuniform_and_pcolor.png b/lib/matplotlib/tests/baseline_images/test_image/nonuniform_and_pcolor.png index cb0aa4815c4e850e335d4823f6803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ests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -1406,6 +1406,27 @@ def test_nonuniform_and_pcolor(): ax.set(xlim=(0, 10)) +@image_comparison(["nonuniform_logscale.png"], style="mpl20") +def test_nonuniform_logscale(): + _, axs = plt.subplots(ncols=3, nrows=1) + + for i in range(3): + ax = axs[i] + im = NonUniformImage(ax) + im.set_data(np.arange(1, 4) ** 2, np.arange(1, 4) ** 2, + np.arange(9).reshape((3, 3))) + ax.set_xlim(1, 16) + ax.set_ylim(1, 16) + ax.set_box_aspect(1) + if i == 1: + ax.set_xscale("log", base=2) + ax.set_yscale("log", base=2) + if i == 2: + ax.set_xscale("log", base=4) + ax.set_yscale("log", base=4) + ax.add_image(im) + + @image_comparison( ['rgba_antialias.png'], style='mpl20', remove_text=True, tol=0 if platform.machine() == 'x86_64' else 0.007)