Skip to content

Commit 1293916

Browse files
authored
Merge pull request #9899 from mattip/tkagg-modal-subplot
make SubplotTool into a modal dialog, keep ref to SubplotTool
2 parents 31ba4f2 + 0ea465a commit 1293916

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/backend_tkagg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,12 +735,13 @@ def _init_toolbar(self):
735735

736736
def configure_subplots(self):
737737
toolfig = Figure(figsize=(6,3))
738-
window = Tk.Tk()
738+
window = Tk.Toplevel()
739739
canvas = FigureCanvasTkAgg(toolfig, master=window)
740740
toolfig.subplots_adjust(top=0.9)
741-
tool = SubplotTool(self.canvas.figure, toolfig)
741+
canvas.tool = SubplotTool(self.canvas.figure, toolfig)
742742
canvas.show()
743743
canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
744+
window.grab_set()
744745

745746
def save_figure(self, *args):
746747
from six.moves import tkinter_tkfiledialog, tkinter_messagebox

0 commit comments

Comments
 (0)