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()

 

360截图20160603154215570

posted @ 2016-06-03 15:41  佩雷尔曼的信徒  阅读(157)  评论(0编辑  收藏  举报