rename tostring_rgb to tostring_argb

This commit is contained in:
Fangjun Kuang 2025-01-02 10:00:34 +08:00
parent 1761b21f06
commit bce18ed564

View File

@ -113,7 +113,7 @@ def plot_feature(spectrogram):
plt.tight_layout()
fig.canvas.draw()
data = np.fromstring(fig.canvas.tostring_rgb(), dtype=np.uint8, sep="")
data = np.fromstring(fig.canvas.tostring_argb(), dtype=np.uint8, sep="")
data = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
plt.close()
return data