使用
fig = plt.figure()
fig.suptitle('this is the figure title')
Run Code Online (Sandbox Code Playgroud)
fig = plt.figure()
plt.title('overall')
ax1 = fig.add_subplot(221)
ax2 = fig.add_subplot(222)
ax3 = fig.add_subplot(223)
ax4 = fig.add_subplot(224)
ax1.title.set_text('First Plot')
ax2.title.set_text('Second Plot')
ax3.title.set_text('Third Plot')
ax4.title.set_text('Fourth Plot')
plt.show()
Run Code Online (Sandbox Code Playgroud)
除了第二行之外的所有内容都是从您发布的链接中复制的。
用python 2.7测试