Skip to content

Commit

Permalink
fix deprecated tostring_rgb
Browse files Browse the repository at this point in the history
  • Loading branch information
Вадим Ахмеров authored and Вадим Ахмеров committed Dec 23, 2024
1 parent 7595be9 commit 841ad41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions golem/visualisation/opt_viz_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 841ad41

Please sign in to comment.