@@ -746,8 +746,7 @@ def configure_subplots(self):
746
746
canvas .get_tk_widget ().pack (side = Tk .TOP , fill = Tk .BOTH , expand = 1 )
747
747
748
748
def save_figure (self , * args ):
749
- from six .moves .tkinter_filedialog import asksaveasfilename
750
- from six .moves .tkinter_messagebox import showerror
749
+ from six .moves import tkinter_tkfiledialog , tkinter_messagebox
751
750
filetypes = self .canvas .get_supported_filetypes ().copy ()
752
751
default_filetype = self .canvas .get_default_filetype ()
753
752
@@ -766,13 +765,13 @@ def save_figure(self, *args):
766
765
# adding a default extension seems to break the
767
766
# asksaveasfilename dialog when you choose various save types
768
767
# from the dropdown. Passing in the empty string seems to
769
- # work - JDH
768
+ # work - JDH!
770
769
#defaultextension = self.canvas.get_default_filetype()
771
770
defaultextension = ''
772
771
initialdir = rcParams .get ('savefig.directory' , '' )
773
772
initialdir = os .path .expanduser (initialdir )
774
773
initialfile = self .canvas .get_default_filename ()
775
- fname = asksaveasfilename (
774
+ fname = tkinter_tkfiledialog . asksaveasfilename (
776
775
master = self .window ,
777
776
title = 'Save the figure' ,
778
777
filetypes = tk_filetypes ,
@@ -794,7 +793,7 @@ def save_figure(self, *args):
794
793
# This method will handle the delegation to the correct type
795
794
self .canvas .print_figure (fname )
796
795
except Exception as e :
797
- showerror ("Error saving file" , str (e ))
796
+ tkinter_messagebox . showerror ("Error saving file" , str (e ))
798
797
799
798
def set_active (self , ind ):
800
799
self ._ind = ind
0 commit comments