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

Skip to content

Commit 8991f9f

Browse files
authored
Merge pull request #10838 from anntzer/publictk
DOC: Don't use private attribute in tk example. Fix Toolbar class rename.
2 parents f254b3b + c081f5a commit 8991f9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/user_interfaces/embedding_in_tk_sgskip.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import tkinter
99

1010
from matplotlib.backends.backend_tkagg import (
11-
FigureCanvasTkAgg, NavigationToolbar2TkAgg)
11+
FigureCanvasTkAgg, NavigationToolbar2Tk)
1212
# Implement the default Matplotlib key bindings.
1313
from matplotlib.backend_bases import key_press_handler
1414
from matplotlib.figure import Figure
@@ -27,9 +27,9 @@
2727
canvas.draw()
2828
canvas.get_tk_widget().pack(side=tkinter.TOP, fill=tkinter.BOTH, expand=1)
2929

30-
toolbar = NavigationToolbar2TkAgg(canvas, root)
30+
toolbar = NavigationToolbar2Tk(canvas, root)
3131
toolbar.update()
32-
canvas._tkcanvas.pack(side=tkinter.TOP, fill=tkinter.BOTH, expand=1)
32+
canvas.get_tk_widget().pack(side=tkinter.TOP, fill=tkinter.BOTH, expand=1)
3333

3434

3535
def on_key_press(event):

0 commit comments

Comments
 (0)