首页 > 其他 > 详细

matplotlib setting zh-hans

时间:2019-08-04 20:15:49      阅读:81      评论:0      收藏:0      [点我收藏+]
 1 from matplotlib import pyplot as plt
 2 from matplotlib import font_manager
 3 
 4 import random
 5 #                             you font famaily location
 6 font_pro = font_manager.FontProperties(fname=C:\Windows\Fonts\SIMYOU.TTF)
 7 
 8 
 9 x=range(0,12,)
10 
11 y=[random.randint(10,40) for it in range(0, 12) ]
12 
13 xlabels=[第{}次.format(i) for i in range(12)]
14 #            add the kwarg 
15 plt.xticks(x,xlabels,fontproperties=font_pro)
16 
17 plt.plot(x,y)
18 plt.show()

 

matplotlib setting zh-hans

原文:https://www.cnblogs.com/jiujue/p/11299035.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!