Functions dealing with text like label
, title
, etc. accept parameters same as matplotlib.text.Text .
(处理label
, title
等文本的函数接受与matplotlib.text.Text相同的参数。)
For the font size you can use size/fontsize
: (对于字体大小,您可以使用size/fontsize
:)
from matplotlib import pyplot as plt
fig = plt.figure()
plt.plot(data)
fig.suptitle('test title', fontsize=20)
plt.xlabel('xlabel', fontsize=18)
plt.ylabel('ylabel', fontsize=16)
fig.savefig('test.jpg')
For globally setting title
and label
sizes, mpl.rcParams
contains axes.titlesize
and axes.labelsize
.
(对于全局设置title
和label
大小, mpl.rcParams
包含axes.titlesize
和axes.labelsize
。)
(From the page): ((来自页面):)
axes.titlesize : large # fontsize of the axes title
axes.labelsize : medium # fontsize of the x any y labels
(As far as I can see, there is no way to set x
and y
label sizes separately.)
((据我所知,没有办法单独设置x
和y
标签尺寸。))
And I see that axes.titlesize
does not affect suptitle
.
(我看到axes.titlesize
不会影响suptitle
。)
I guess, you need to set that manually. (我想,你需要手动设置。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…