Python 如何使用matplotlib使specgram填充整个地物区域?

Python 如何使用matplotlib使specgram填充整个地物区域?,python,matplotlib,Python,Matplotlib,我正在使用以下代码绘制specgram: fig = plt.figure(figsize=(5.15, 5.15)) fig.clf() plot = plt.subplot(111) plt.specgram(data, NFFT = 256, Fs = 120000) plot.grid(False, which="major") plot.set_xlabel(r'\textit{Time (s)}', labelpad=6) plot.set_ylabel(r'\textit{{Fre

我正在使用以下代码绘制specgram:

fig = plt.figure(figsize=(5.15, 5.15))
fig.clf()
plot = plt.subplot(111)
plt.specgram(data, NFFT = 256, Fs = 120000)
plot.grid(False, which="major")
plot.set_xlabel(r'\textit{Time (s)}', labelpad=6)
plot.set_ylabel(r'\textit{{Frequency (Hz)}}', labelpad=6)
plt.colorbar()
fig.savefig('specgram.pdf', bbox_inches='tight')
plt.close()
但specgram不会填充整个地物区域,如下所示:

我可能做错了什么?

我认为您需要最大限度地利用数据