Python 中文乱码matplotlib乱码 (Windows)
来源:互联网 发布:林瀚的爷爷 知乎 编辑:程序博客网 时间:2024/05/29 16:51
Python解决matplotlib中文乱码问题(Windows)
matplotlib是Python著名的绘图库,默认并不支持中文显示,因此在不经过修改的情况下,无法正确显示中文。本文将介绍如何解决这一问题的方法。
1.修改matplotlibrc文件
进入Python安装目录下的Lib\site-packages\matplotlib\mpl-data目录,打开matplotlibrc文件,删除font.family和font.sans-serif两行前的#,并在font.sans-serif后添加微软雅黑字体(Microsoft YaHei),代码如下:
font.family : sans-seriffont.sans-serif : Microsoft YaHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
2.代码中别忘了unicode编码
转载自http://www.pythoner.com/200.html
0 0
- Python 中文乱码matplotlib乱码 (Windows)
- Python Matplotlib 中文乱码
- python matplotlib中文乱码问题
- python matplotlib 中文显示乱码
- 解决matplotlib中文乱码问题(Windows)
- 解决matplotlib中文乱码问题(Windows)
- 解决matplotlib中文乱码问题(Windows)
- python matplotlib中文显示乱码解决
- python matplotlib.pyplot出现中文乱码问题
- matplotlib中文乱码解决方法
- matplotlib中文乱码解决方法
- matplotlib图例中文乱码
- Matplotlib中文乱码解决方案
- matplotlib中文乱码解决
- 解决Windows系统下python利用matplotlib绘图时中文乱码的问题
- Python 3下Matplotlib画图中文显示乱码的解决方法
- Linux环境下修改python matplotlib显示中文乱码方格
- Python 3下Matplotlib画图中文显示乱码的解决方法
- IOS锁屏状态播放音乐时显示专辑信息和图片
- Scramble String
- 黑马程序员--泛型
- Github上的PHP资源汇总
- 那些年专注于SDN的组织与他们的控制器
- Python 中文乱码matplotlib乱码 (Windows)
- (1157)POJ
- Android 后退键onBackPressed()的使用介绍
- 最长回文子串 leetcode 05 DP解法
- Android DrawerLayout+fragment布局实现左右侧滑
- threaded interrupt handler support
- C++ 智能指针详解
- concurrentHashMap 到底采取了什么措施使得它比synchronized(HashMap)好
- iOS-不用ID的打包方法