Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/matplotlib/artist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down