|
11 | 11 | import numpy as np |
12 | 12 |
|
13 | 13 | import matplotlib |
14 | | -from matplotlib import backend_tools, rcParams |
| 14 | +from matplotlib import backend_tools, cbook, rcParams |
15 | 15 | from matplotlib.backend_bases import ( |
16 | 16 | _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, |
17 | 17 | StatusbarBase, TimerBase, ToolContainerBase, cursors) |
@@ -547,8 +547,7 @@ def set_cursor(self, cursor): |
547 | 547 | window.update_idletasks() |
548 | 548 |
|
549 | 549 | def _Button(self, text, file, command, extension='.gif'): |
550 | | - img_file = os.path.join( |
551 | | - rcParams['datapath'], 'images', file + extension) |
| 550 | + img_file = str(cbook._get_data_path('images', file + extension)) |
552 | 551 | im = tk.PhotoImage(master=self, file=img_file) |
553 | 552 | b = tk.Button( |
554 | 553 | master=self, text=text, padx=2, pady=2, image=im, command=command) |
@@ -884,8 +883,7 @@ def new_figure_manager_given_figure(cls, num, figure): |
884 | 883 | # Tkinter doesn't allow colour icons on linux systems, but tk>=8.5 |
885 | 884 | # has a iconphoto command which we call directly. Source: |
886 | 885 | # http://mail.python.org/pipermail/tkinter-discuss/2006-November/000954.html |
887 | | - icon_fname = os.path.join( |
888 | | - rcParams['datapath'], 'images', 'matplotlib.ppm') |
| 886 | + icon_fname = str(cbook._get_data_path('images/matplotlib.ppm')) |
889 | 887 | icon_img = tk.PhotoImage(file=icon_fname, master=window) |
890 | 888 | try: |
891 | 889 | window.iconphoto(False, icon_img) |
|
0 commit comments