Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e7d498c + 32b914f commit 89fa0e4Copy full SHA for 89fa0e4
lib/matplotlib/backends/_backend_tk.py
@@ -431,6 +431,17 @@ def _get_toolbar(self):
431
return toolbar
432
433
def resize(self, width, height):
434
+ max_size = 1_400_000 # the measured max on xorg 1.20.8 was 1_409_023
435
+
436
+ if (width > max_size or height > max_size) and sys.platform == 'linux':
437
+ raise ValueError(
438
+ 'You have requested to resize the '
439
+ f'Tk window to ({width}, {height}), one of which '
440
+ f'is bigger than {max_size}. At larger sizes xorg will '
441
+ 'either exit with an error on newer versions (~1.20) or '
442
+ 'cause corruption on older version (~1.19). We '
443
+ 'do not expect a window over a million pixel wide or tall '
444
+ 'to be intended behavior.')
445
self.canvas._tkcanvas.configure(width=width, height=height)
446
447
def show(self):
0 commit comments