8000 Fixed similar bug in wx backend. · matplotlib/matplotlib@6ff693a · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ff693a

Browse files
committed
Fixed similar bug in wx backend.
1 parent cb89b01 commit 6ff693a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/backends/backend_wx.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,9 @@ def _icon(name):
11121112
*name*, including the extension and relative to Matplotlib's "images"
11131113
data directory.
11141114
"""
1115-
image = np.array(PIL.Image.open(cbook._get_data_path("images", name)))
1115+
pilimg = PIL.Image.open(cbook._get_data_path("images", name))
1116+
# ensure RGBA as wx BitMap expects RGBA format
1117+
image = np.array(pilimg.convert("RGBA"))
11161118
try:
11171119
dark = wx.SystemSettings.GetAppearance().IsDark()
11181120
except AttributeError: # wxpython < 4.1

0 commit comments

Comments
 (0)
0