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 3e98746 + 04a55eb commit bd6fc99Copy full SHA for bd6fc99
1 file changed
lib/matplotlib/backends/_backend_tk.py
@@ -460,6 +460,17 @@ def _get_toolmanager(self):
460
return toolmanager
461
462
def resize(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_size or height > max_size) and sys.platform == 'linux':
466
+ raise ValueError(
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.')
474
self.canvas._tkcanvas.configure(width=width, height=height)
475
476
def show(self):
0 commit comments