python matplotlib 字体解决


问题描述


解决方法:

centos6.5 下解决方案:

snippet.bash
wget http://www.itzgeek.com/msttcore-fonts-2.0-3.noarch.rpm
rpm -Uvh msttcore-fonts-2.0-3.noarch.rpm
snippet.bash
rm -rf  ~/.cache/matplotlib/
snippet.python
import matplotlib as mpl
mpl.rcParams['font.sans-serif'].insert(0, u'Arial')
mpl.rcParams['font.family'] = [u'sans-serif',]
mpl.rcParams['svg.fonttype'] = 'none'