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

Commitbd6fc99

Browse files
authored
Merge pull request#17562 from meeseeksmachine/auto-backport-of-pr-17470-on-v3.2.x
Backport PR#17470 on branch v3.2.x (FIX: add guardrails for too big tk figures)
2 parents3e98746 +04a55eb commitbd6fc99

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎lib/matplotlib/backends/_backend_tk.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,17 @@ def _get_toolmanager(self):
460460
returntoolmanager
461461

462462
defresize(self,width,height):
463+
max_size=1_400_000# the measured max on xorg 1.20.8 was 1_409_023
464+
465+
if (width>max_sizeorheight>max_size)andsys.platform=='linux':
466+
raiseValueError(
467+
'You have requested to resize the '
468+
f'Tk window to ({width},{height}), one of which '
469+
f'is bigger than{max_size}. At larger sizes xorg will '
470+
'either exit with an error on newer versions (~1.20) or '
471+
'cause corruption on older version (~1.19). We '
472+
'do not expect a window over a million pixel wide or tall '
473+
'to be intended behavior.')
463474
self.canvas._tkcanvas.configure(width=width,height=height)
464475

465476
defshow(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp