Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit185b4fa

Browse files
committed
fix: Fix unstable tkagg small plot size.
1 parent4af11e7 commit185b4fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎lib/matplotlib/backends/_backend_tk.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,14 @@ def __init__(self, canvas, window=None, *, pack_toolbar=True):
638638
window=canvas.get_tk_widget().master
639639
tk.Frame.__init__(self,master=window,borderwidth=2,
640640
width=int(canvas.figure.bbox.width),height=50)
641+
# Avoid message_label expanding the toolbar size, and in turn expanding the
642+
# canvas size.
643+
# Without pack_propagate(False), when the user defines a small figure size
644+
# (e.g. 2x2):
645+
# 1. Figure size that is bigger than the user's expectation.
646+
# 2. When message_label is refreshed by mouse enter/leave, the canvas
647+
# size will also be changed.
648+
self.pack_propagate(False)
641649

642650
self._buttons= {}
643651
fortext,tooltip_text,image_file,callbackinself.toolitems:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp