如何在pylab / python中设置图形窗口的标题?
fig = figure(9) # 9 is now the title of the window
fig.set_title("Test") #doesn't work
fig.title = "Test" #doesn't work
Answers:
如果要实际更改窗口,可以执行以下操作:
fig = pylab.gcf()
fig.canvas.set_window_title('Test')
from pylab import *
和导入pylab pylab.title("test")
,title("test")
但无法正常工作。
您也可以在创建图形时设置窗口标题:
fig = plt.figure("YourWindowName")
If num is a string, the window title will be set to this figure's num.
我看到大多数人都输入数字,因此直接输入标题会更好。谢谢!
plt.suptitle('figure title')
并plt.gcf().canvas.set_window_title('window title')
与plt.figure('window title')