From 2a7e1fe87bc2bc571a7f5d3778f13b8076852352 Mon Sep 17 00:00:00 2001 From: SjoerdB93 Date: Thu, 11 May 2023 14:03:46 +0200 Subject: [PATCH 1/2] fix hidpi scaling --- lib/matplotlib/backends/backend_gtk4cairo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/backends/backend_gtk4cairo.py b/lib/matplotlib/backends/backend_gtk4cairo.py index d57f53fb28d6..8f56bd6b2a33 100644 --- a/lib/matplotlib/backends/backend_gtk4cairo.py +++ b/lib/matplotlib/backends/backend_gtk4cairo.py @@ -19,6 +19,8 @@ def on_draw_event(self, widget, ctx): self.get_style_context(), ctx, allocation.x, allocation.y, allocation.width, allocation.height) + self._renderer.width = allocation.width * scale + self._renderer.height = allocation.height * scale self._renderer.dpi = self.figure.dpi self.figure.draw(self._renderer) From eebb43add3d840a6f10722987bbf9c92e00fe2e7 Mon Sep 17 00:00:00 2001 From: SjoerdB93 Date: Fri, 12 May 2023 15:18:36 +0200 Subject: [PATCH 2/2] apply fix to gtk3cairo --- lib/matplotlib/backends/backend_gtk3cairo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/backends/backend_gtk3cairo.py b/lib/matplotlib/backends/backend_gtk3cairo.py index 1da8419e5381..b9f3545cbda3 100644 --- a/lib/matplotlib/backends/backend_gtk3cairo.py +++ b/lib/matplotlib/backends/backend_gtk3cairo.py @@ -17,6 +17,8 @@ def on_draw_event(self, widget, ctx): self.get_style_context(), ctx, allocation.x, allocation.y, allocation.width, allocation.height) + self._renderer.width = allocation.width * scale + self._renderer.height = allocation.height * scale self._renderer.dpi = self.figure.dpi self.figure.draw(self._renderer)