Matplotlib中文设置
1.中文设置方法,代码前加入语句
from pylab import mpl mpl.rcParams['font.sans-serif'] = ['SimHei']
2.例子
# -*- coding: utf-8 -*- import matplotlib.pyplot as Plot from pylab import mpl mpl.rcParams['font.sans-serif'] = ['SimHei'] Plot.figure(u'一') Plot.title(u'二') Plot.scatter(0.5, 0.5) Plot.text(0.5, 0.5, u'三') Plot.legend((u'四')) Plot.xlabel(u'五') Plot.ylabel(u'六') Plot.show()