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

Skip to content

Commit d91aa31

Browse files
authored
Merge pull request #11697 from meeseeksmachine/auto-backport-of-pr-11694-on-v2.2.x
Backport PR #11694 on branch v2.2.x
2 parents d3db42c + e3d2166 commit d91aa31

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/matplotlib/backends/_backend_tk.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,13 @@ def __init__(self, canvas, num, window):
472472
self.window.withdraw()
473473
self.set_window_title("Figure %d" % num)
474474
self.canvas = canvas
475+
# If using toolmanager it has to be present when initializing the toolbar
476+
self.toolmanager = self._get_toolmanager()
475477
# packing toolbar first, because if space is getting low, last packed widget is getting shrunk first (-> the canvas)
476478
self.toolbar = self._get_toolbar()
477479
self.canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)
478480
self._num = num
479481

480-
self.toolmanager = self._get_toolmanager()
481482
self.statusbar = None
482483

483484
if self.toolmanager:

0 commit comments

Comments
 (0)