【问题标题】:How to make specgram fill entire figure area with matplotlib?如何使用 matplotlib 使 Specgram 填充整个图形区域?
【发布时间】:2015-03-29 04:22:45
【问题描述】:

我正在使用以下代码绘制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并没有填满整个图形区域,如下图:

我可能做错了什么?

【问题讨论】:

    标签: python matplotlib


    【解决方案1】:

    我认为你需要set_xlim 到你数据的最大值。

    【讨论】:

      猜你喜欢
      • 2021-07-24
      • 2016-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多