[Matplotlib-users] How do i store plot data as numpy ndarray..
Carlton Banks
noflaco at gmail.com
Sat May 13 05:50:54 EDT 2017
Hi guys..
I seem to have a problems with converting my plot to a numpy ndarray -
Such that if I made a imshow of the numpy ndarray i would see am image similar to the lmage i created..
librosa.display.specshow(static.T,sr=16000,x_axis='frames',y_axis='mel',hop_length=160,cmap=cm.jet)
plt.title("log mel power spectrum of " + name)
plt.colorbar(format='%+02.0f dB')
plt.tight_layout()
plt.savefig(plot+"/"+name+"_plot_static_conv.png")
plt.show()
This will show an image such as:
But if i try to store it as a numpy ndarray and then trying to plot it using this code
convert = plt.get_cmap(cm.jet)
numpy_output_static = convert(static.T)
plt.imshow(numpy_output_static)
plt.show()
raw_input("sadas")
I see something like this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170513/8501bb42/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JPR6G.png
Type: image/png
Size: 82582 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170513/8501bb42/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2WGgJ.png
Type: image/png
Size: 9306 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170513/8501bb42/attachment-0003.png>
More information about the Matplotlib-users
mailing list