Skip to content

Commit

Permalink
Merge pull request #44 from usnistgov/43-visualizer-broken-on-new-ver…
Browse files Browse the repository at this point in the history
…sions-of-mpl

updated to use np.array(fig.canvas.buffer_rgba() and changed reshape …
  • Loading branch information
delongchamp authored Dec 22, 2024
2 parents 0341c10 + fdaa935 commit 08b0185
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NRSS/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,8 @@ def morphology_visualizer(

if outputmat and (i in outputmat):
fig.canvas.draw()
rgb_return = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
rgb_return = rgb_return.reshape(fig.canvas.get_width_height()[::-1] + (3,))
rgb_return = np.array(fig.canvas.buffer_rgba(), dtype=np.uint8)
rgb_return = rgb_return.reshape(fig.canvas.get_width_height()[::-1] + (4,))
if outputplot and ("vfrac" in outputplot):
if outputaxes:
fig_xl = ax1.get_tightbbox().intervalx[0].astype(int)
Expand Down

0 comments on commit 08b0185

Please sign in to comment.