It seems that I have some problems with saving the graph created with matplotlib.pcolormesh(). As far as I know, pcolormeshconverts the input matrix using a color map. The color palette displays the RGB value for each entry in the matrix and displays it.
What in my head will look like
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from PIL import Image
import librosa
import librosa.display
from matplotlib import cm
fig = plt.figure(figsize=(12,4))
min = -1.828067
max = 22.70058
data = np.random.uniform(low=min, high=max, size=(474,40))
librosa.display.specshow(data.T,sr=16000,x_axis='frames',y_axis='mel',hop_length=160,cmap=cm.jet)
plt.axis('off')
plt.show()
raw_input("sadas")
convert = plt.get_cmap(cm.jet)
norm = matplotlib.colors.Normalize(vmin=0,vmax=1)
numpy_output_static = convert(norm(data.T))
plt.imshow(numpy_output_static,cmap = cm.jet, aspect = 'auto')
plt.show()
raw_input("asds")


The problem is that the numpy array of data represented as a graph is not like the first graph shows. I need numpy to have the data that represents the graph, so if I wanted to build it, I would get an identical image as the first, and the shape of the numpy array should be similar to the input that was used in section 1.
, , , .
, , .
matplotlib, .