我有一个数字包含许多子块。
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()
的输入错误。谢谢拉特格·卡西
假设的速记回答
import matplotlib.pyplot as plt
:如所示:
那么就不需要多余的变量了。
ax.title.set_text('My Plot Title')
似乎也起作用。ax.set_title()
应该为单独的子批次设置标题:你能检查一下这个代码是否适合你吗?也许以后会有什么东西覆盖它们?
相关问题 更多 >
编程相关推荐