From 841ad411f7be47c480a9e7096a92925bba179dbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D0=B4=D0=B8=D0=BC=20=D0=90=D1=85=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D0=BE=D0=B2?= Date: Tue, 24 Dec 2024 01:41:33 +0300 Subject: [PATCH] fix deprecated tostring_rgb --- golem/visualisation/opt_viz_extra.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/golem/visualisation/opt_viz_extra.py b/golem/visualisation/opt_viz_extra.py index 13eb83a2..b67c81c1 100644 --- a/golem/visualisation/opt_viz_extra.py +++ b/golem/visualisation/opt_viz_extra.py @@ -279,8 +279,8 @@ def extract_objectives(individuals: List[List[Any]], objectives_numbers: Tuple[i def figure_to_array(fig): - img = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8) - img = img.reshape(fig.canvas.get_width_height()[::-1] + (3,)) + img = np.frombuffer(fig.canvas.buffer_rgba(), dtype=np.uint8) + img = img.reshape(fig.canvas.get_width_height()[::-1] + (4,)) return img