Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6b53724

Browse files
daniilStimhoffm
andauthored
Fix older versions of Pillow
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent d79cdeb commit 6b53724

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def _set_image_for_button(self, button):
665665
# the dark background.
666666
foreground = (255 / 65535) * np.array(
667667
button.winfo_rgb(button.cget("foreground")))
668-
image_data = np.asarray(im)
668+
image_data = np.asarray(im).copy()
669669
black_mask = (image_data[..., :3] == 0).all(axis=-1)
670670
image_data[black_mask, :3] = foreground
671671
im = Image.fromarray(image_data, mode="RGBA")

0 commit comments

Comments
 (0)