matplot库问题
字体问题
先安装字体。 必须要这个,因为可以兼容中文等。
安装字体教程: http://www.handsomemark.com/blog/detail/6580177df8c0d8f5f18225e1 可直接运行如下命令
import os
if __name__ == '__main__':
import matplotlib as mpl
print(mpl.get_cachedir())
os.system("rm -rf" + mpl.get_cachedir())
cd ~
mkdir ~/.fonts
cd ~/.fonts
wget http://129.204.205.246/downloads/SimHei.ttf
brew install fontconfig
fc-cache -fv
设置字体
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False