Skip to content Skip to sidebar Skip to footer

Why Is Image Stored Different Than The One Imshowed?

I am currently not able to understand why I am not able to recreate the plot after I store the data.. import os import sys from os import listdir from os.path import isfile, join

Solution 1:

Nothing is wrong, everything seems to work as expected as far as I can tell without having the data or knowing the array shapes.

However, if you want to have your imshow plot look similar to the one produced by librosa, you may first consider to use an unequal aspect

plt.imshow(...,  aspect="auto")

and possibly set the data range of the plot correctly using the extent argument of imshow.

Also be aware that the plot produced by librosa is a pcolormesh, so to truely replicate it, you might want to keep your data in the format it is (not putting it through a colormap) and use pcolormesh to plot it.


Post a Comment for "Why Is Image Stored Different Than The One Imshowed?"