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

Skip to content

Commit 2b454b7

Browse files
daniilSQuLogic
andauthored
Use with_name
Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent 0174cae commit 2b454b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,8 @@ def _set_image_for_button(self, button):
646646
# Allow _image_file to be relative to Matplotlib's "images" data
647647
# directory.
648648
path_regular = cbook._get_data_path('images', button._image_file)
649-
path_large = cbook._get_data_path(
650-
'images', button._image_file.replace('.png', '_large.png'))
649+
path_large = path_regular.with_name(
650+
button._image_file.replace('.png', '_large.png'))
651651
size = button.winfo_pixels('18p')
652652
# Use the high-resolution (48x48 px) icon if it exists and is needed
653653
with Image.open(path_large if (size > 24 and path_large.exists())

0 commit comments

Comments
 (0)