坐标轴,标题使用特定字体
from matplotlib import pyplot as plt
from matplotlib.font_manager import FontProperties
...
ax.set_ylabel('Value', fontproperties=FontProperties(family="Times New Roman", size=fontsize)) # 使用Times New Roman字体
plt.title('典型的KPI变化类型', fontproperties=FontProperties(family="STSong", size=fontsize*1.2)) # 使用宋体
图例使用特定字体
plt.legend(loc='center', bbox_to_anchor=(0.5, 1.09), prop={'family':"Times New Roman", 'size':fontsize}, ncol=3)
字体 字体名
黑体 SimHei
楷体 KaiTi
隶书 LiSu
幼圆 YouYuan
华文细黑 STXihei
华文楷体 STKaiti
华文宋体 STSong
华文中宋 STZhongsong
华文仿宋 STFangsong
方正舒体 FZShuTi
方正姚体 FZYaoti
华文彩云 STCaiyun
华文琥珀 STHupo
华文隶书 STLiti
华文行楷 STXingkai
华文新魏 STXinwei