Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何更改mel光谱图的大小?_Python_Matplotlib_Audio_Librosa - Fatal编程技术网

Python 如何更改mel光谱图的大小?

Python 如何更改mel光谱图的大小?,python,matplotlib,audio,librosa,Python,Matplotlib,Audio,Librosa,我想将3个mel光谱图保存到一个png文件中。我为此使用了subplot函数 fig, ax = plt.subplots(nrows=3, ncols=1) img1 = librosa.display.specshow(S_dB1, sr=sr, fmax=10000, ax=ax[0]) img2 = librosa.display.specshow(S_dB2, sr=sr, fmax=10000, ax=ax[1]) img3 = librosa.display.specshow(S_

我想将3个mel光谱图保存到一个png文件中。我为此使用了subplot函数

fig, ax = plt.subplots(nrows=3, ncols=1)
img1 = librosa.display.specshow(S_dB1, sr=sr, fmax=10000, ax=ax[0])
img2 = librosa.display.specshow(S_dB2, sr=sr, fmax=10000, ax=ax[1])
img3 = librosa.display.specshow(S_dB3, sr=sr, fmax=10000, ax=ax[2])
fig.savefig('img.png')
这就是生成的mel光谱图的样子


是否可以更改这些mel光谱图的高度以使其更易于阅读?

要控制图形的纵横比,请使用fig size。它是以英寸为单位的(宽度、高度)

fig, ax = plt.subplots(nrows=3, ncols=1, figsize=(16,16))