matplotlib中文乱码解决方法
2018-01-13 14:34
627 查看
每次编写代码时进行参数设置
import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
一劳永逸(推荐) 一劳永逸法各个电脑不一样,我看网上很多种方法,找适合自己电脑的。
自己电脑测试可行:
平台:windows7, python3.6
步骤一:打开设置文件
import matplotlib
matplotlib.matplotlib_fname()
会显示matplotlibrc文件的地址
步骤二:修改matplotlibrc文件
将文件中的
#font.family: sans-serif
去掉注释,修改为
font.family: Microsoft YaHei
可显示为中文
作者:皓冉 Eva
链接:https://www.zhihu.com/question/25404709/answer/130258500
来源:知乎
相关文章推荐
- matplotlib中文乱码解决方法
- matplotlib中文乱码解决方法
- ubuntu系统下matplotlib中文乱码问题的解决方法
- Python 3下Matplotlib画图中文显示乱码的解决方法
- Python 3下Matplotlib画图中文显示乱码的解决方法
- matplotlib中文乱码解决方法
- 真·matplotlib中文乱码问题·解决方法
- matplotlib 与 seaborn 中出现中文乱码的解决方法
- matplotlib中文无法显示的解决方法
- 解决matplotlib中文乱码问题
- matplotlib中文乱码解决
- 一次解决Matplotlib绘图中的中文乱码问题
- 解决matplotlib中文乱码问题(Windows)
- 在matplotlib中,解决中文乱码问题
- 西瓜书 习题4.3 编程实现信息熵决策树、绘制决策树、解决matplotlib中文乱码问题
- Matplotlib中文乱码解决办法
- 彻底解决matplotlib中文乱码问题
- Ubuntu下matplotlib中文无法显示的解决方法
- 彻底解决matplotlib中文乱码问题
- matplotlib图例中文乱码解决