1、下載中文包
https://github.com/StellarCN/scp_zh/blob/master/fonts/SimHei.ttf
2、查找matplotlib所在的檔案路徑
python3
然后在python3中輸入
>>>import matplotlib
>>>matplotlib.matplotlib_fname()
檔案路徑
>>>exit()
3、將SimHei.ttf檔案復制到mpl-data/fonts/ttf/檔案夾下
4、更改matplotlibrc檔案
font.family : sans-serif
font.sans-serif : SimHei
axes.unicode_minus : False
5、重新加載字體
python3
>>>from matplotlib.font_manager import _rebuild
>>>_rebuild()
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/148793.html
標籤:其他
上一篇:P1008 三連擊
下一篇:學習第43天
