Debug --> matlibplot的字体设置方法

plt.figure(figsize=[15,8]) 
plt.scatter(X, Y, label = 'label')
plt.plot(X, func(X, a, b), 'red', label = 'label') 
plt.title('title', fontdict={'family' : 'Times New Roman', 'size' : 16})
plt.ylabel('y', fontdict={'family' : 'Times New Roman', 'size' : 16})
plt.xlabel('x', fontdict={'family' : 'Times New Roman', 'size' : 16})
plt.yticks(fontproperties = 'Times New Roman', size = 14) 
plt.xticks(fontproperties = 'Times New Roman', size = 14) 
plt.legend(prop={'family' : 'Times New Roman', 'size' : 16})
plt.savefig('./workspace/' + name + '.ps', dpi = 200) 
plt.tight_layout()
plt.show()

 

posted @ 2021-06-03 10:33  阿洛萌萌哒  阅读(226)  评论(0编辑  收藏  举报