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

Skip to content

Commit 05c9a12

Browse files
authored
Merge pull request #11599 from matplotlib/auto-backport-of-pr-11559-on-v2.2.x
Backport PR #11559 on branch v2.2.x
2 parents cf526b1 + 7340ceb commit 05c9a12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/_backend_tk.py

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

478480
self.toolmanager = self._get_toolmanager()
479-
self.toolbar = self._get_toolbar()
480481
self.statusbar = None
481482

482483
if self.toolmanager:

0 commit comments

Comments
 (0)