我有一个包含许多子图的图
fig = plt.figure(num=None, figsize=(26, 12), dpi=80, facecolor='w', edgecolor='k')
fig.canvas.set_window_title('Window Title')
# Returns the Axes instance
ax = fig.add_subplot(311)
ax2 = fig.add_subplot(312)
ax3 = fig.add_subplot(313)
如何向子地块添加标题
fig.suptitle
为所有图添加标题,尽管ax.set_title()
存在,但后者不会向我的子图添加任何标题
谢谢你的帮助
编辑:
更正了set_title()
的打字错误。谢谢Rutger Kassies
速记答案
import matplotlib.pyplot as plt
:例如:
那么就不需要多余的变量了
ax.set_title()
应为单独的子批次设置标题:你能检查一下这个代码是否适合你吗?也许以后有什么东西会覆盖它们
ax.title.set_text('My Plot Title')
似乎也起作用相关问题 更多 >
编程相关推荐