Win 10系统matplotlib中文无法显示的解决方案
2017-09-16 11:58
736 查看
环境:
Win 10,Python 3.6
安装过程请参考 Win 7/10安装numpy、pandas、scipy和matplotlib
程序:
运行结果:
上图中,中文没有正确显示出来。
解决方案:
进入Python安装目录下的Lib\site-packages\matplotlib\mpl-data目录,打开matplotlibrc文件,删除font.family和font.sans-serif两行前的#,并在font.sans-serif后添加微软雅黑字体(Microsoft YaHei)
重新运行程序,正常显示中文:
Win 10,Python 3.6
安装过程请参考 Win 7/10安装numpy、pandas、scipy和matplotlib
程序:
import numpy as np import matplotlib.pyplot as plt x=np.arange(0,2*np.pi,0.01) y=np.sin(x) plt.plot(x,y) plt.xlabel("x轴") plt.ylabel("y轴") plt.title("sin函数") plt.show()
运行结果:
上图中,中文没有正确显示出来。
解决方案:
进入Python安装目录下的Lib\site-packages\matplotlib\mpl-data目录,打开matplotlibrc文件,删除font.family和font.sans-serif两行前的#,并在font.sans-serif后添加微软雅黑字体(Microsoft YaHei)
重新运行程序,正常显示中文:
相关文章推荐
- matplotlib绘图中中文显示乱码问题的解决方案
- python画图包seaborn和matplotlib中文字体显示(针对windows系统,,使用ipython notebook)
- python matplotlib plot 数据中的中文无法正常显示的解决办法
- Ubuntu下matplotlib中文无法显示的解决方法
- Python中,matplotlib绘图无法显示中文的问题
- linux 下matplotlib 无法显示中文字体的问题
- python的matplotlib画图时无法显示中文的解决方法
- matplotlib命令与格式:系统字体与显示中文
- Python 中,matplotlib绘图无法显示中文的问题
- Python 中,matplotlib绘图无法显示中文的问题
- Matplotlib 作图中文无法显示
- Python 中,matplotlib绘图无法显示中文的问题
- python matplotlib plot 数据中的中文无法正常显示的解决办法
- matplotlib绘图显示中文乱码解决方案
- 关于Mac系统下matplotlib中文显示方块问题
- 解决mac上matplotlib(plot)无法显示中文的问题 (Python)
- 基于Linux系统中python matplotlib画图的中文显示问题的解决方法
- Python使用matplotlib绘图无法显示中文问题的解决方法
- 解决Linux系统中python matplotlib画图的中文显示问题
- Mac系统彻底解决matplotlib中文显示乱码的问题