Matplotlib中文显示的问题
来源:互联网 发布:卡盟网络 编辑:程序博客网 时间:2024/05/26 19:19
- from
pylab import* - mpl.rcParams['font.family']
=" SimHei"#指定默认字体 -
- mpl.rcParams['axes.unicode_minus']
= False#解决保存图像是负号'-'显示为方块的问题 -
- t
= arange(-5*pi, 5*pi, 0.01) - y
= sin(t)/t - plt.plot(t,
y) - plt.title(u'这里写的是中文')
- plt.xlabel(u'X坐标')
- plt.ylabel(u'Y坐标')
- plt.show()
-
-
-
-
-
- #第二种方法
-
- #
-*- coding: utf-8 -*- - from
pylab import* - myfont
= matplotlib.font_manager.FontProperties(fname='C:/Windows/Fonts/msyh.ttf') - mpl.rcParams['axes.unicode_minus']
= False - t
= arange(-5*pi, 5*pi, 0.01) - y
= sin(t)/t - plt.plot(t,
y) - plt.title(u'这里写的是中文',fontproperties=myfont)
#指定字体 - plt.xlabel(u'X坐标',fontproperties=myfont)
- plt.ylabel(u'Y坐标',fontproperties=myfont)
- plt.show()
0 0
- Matplotlib中文显示的问题
- Matplotlib中文显示的问题
- Matplotlib中文显示的问题
- matplotlib显示中文问题
- matplotlib显示中文问题
- matplotlib中文显示问题
- Python matplotlib画图的中文显示问题
- matplotlib 中文显示问题的解决办法
- matplotlib输出图象的中文显示问题
- python matplotlib中文显示问题
- python matplotlib中文显示问题
- python matplotlib中文显示问题
- Matplotlib输出中文显示问题
- Matplotlib输出中文显示问题
- python matplotlib中文显示问题
- matplotlib图例中文显示问题
- Matplotlib输出中文显示问题
- matplotlib中文显示方块问题
- string
- 【JZOJ 4811】【NOIP2016提高组 五校联考1】排队
- effective stl 第47条:避免产生“直写型”的代码
- hdu 4790 Just Random 2013 Asia Chengdu Regional Contest [数学]【思维】
- 【回归分析】[3]--回归方程的显著性检验
- Matplotlib中文显示的问题
- 配置魔药(双线程序列动态规划)
- 读书笔记1:《C++沉思录》
- 121-path sum2
- CSDN-markdown语法参考
- c/c++ 中的 struct和typedef struct
- 【C++心路历程3】我终于写出来了 死妈分治算法
- 矩阵快速幂 NOY 301
- 求100之内的素数。