matplotlib setting zh-hans
生活随笔
收集整理的這篇文章主要介紹了
matplotlib setting zh-hans
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
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()
?
轉載于:https://www.cnblogs.com/jiujue/p/11299035.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的matplotlib setting zh-hans的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ValueError: Program
- 下一篇: python中对文件进行读和写