diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py index 5c3f6dc5952f..8457544786bd 100644 --- a/lib/matplotlib/artist.py +++ b/lib/matplotlib/artist.py @@ -763,10 +763,9 @@ def set_clip_box(self, clipbox): clipping for an artist added to an Axes. """ - if clipbox != self.clipbox: - self.clipbox = clipbox - self.pchanged() - self.stale = True + self.clipbox = clipbox + self.pchanged() + self.stale = True def set_clip_path(self, path, transform=None): """ diff --git a/lib/matplotlib/tests/test_image.py b/lib/matplotlib/tests/test_image.py index aeeebd136b65..afbdde032441 100644 --- a/lib/matplotlib/tests/test_image.py +++ b/lib/matplotlib/tests/test_image.py @@ -1076,6 +1076,8 @@ def test_respects_bbox(): # Make the image invisible in axs[1], but visible in axs[0] if we pan # axs[1] up. im.set_clip_box(axs[0].bbox) + # and ndarray should also be okay + im.set_clip_box(np.array(axs[0].bbox)) buf_before = io.BytesIO() fig.savefig(buf_before, format="rgba") assert {*buf_before.getvalue()} == {0xff} # All white.