【发布时间】:2018-07-01 22:41:15
【问题描述】:
我想使用以下代码在 python3 中创建频谱图的子图。 我的问题是我在地块和
之间有空格import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
j=0
plt.clf()
f, axarr= plt.subplots(4,5, gridspec_kw = {'wspace':0, 'hspace':0})
f.tight_layout()
for i, ax in enumerate(f.axes):
j=j+1
im = ax.imshow(syllable_1.transpose(), vmin=0, vmax=syllable_1.max(),
cmap='pink_r')
plt.xticks([], [])
#ax[j].autoscale_view('tight')
#ax.set_xticklabels([])
#ax.set_yticklabels([])
#plt.subplots_adjust(left=0.1, right=0.85, top=0.85, bottom=0.1)
plt.subplots_adjust(wspace=0, hspace=0)
plt.savefig("myfig9.png", bbox_inches='tight')
结果如下:
你能建议我一些解决方案吗?
提前致谢
【问题讨论】:
标签: matplotlib python-3.5 subplot imshow