/backend_agg.py:238: RuntimeWarning: Glyph 26085 missing from current font.
linux 使用python matplotlib画图时没有字体显示中文,导致中文乱码
- 字体下载链接: https://github.com/Heath-Ledger/WorkFile/blob/main/simhei.ttf
- 刷新字体:
ubuntu@VM-0-10-ubuntu:~$ sudo fc-cache -f -v
- 删除matplotlib字体缓存 rm -rf /home/ubuntu/.cache/matplotlib
# 查看字体缓存路径
ubuntu@VM-0-10-ubuntu:~$ python3>>> import matplotlib as plt
>>> plt.get_cachedir()
'/home/ubuntu/.cache/matplotlib'
- 然后在python中指定字体,即可正常显示中文
import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['SimHei']
/backend_agg.py:238: RuntimeWarning: Glyph 26085 missing from current font.相关推荐
- RuntimeWarning:Glyph 21435 missing from current font.
RuntimeWarning:Glyph 21435 missing from current font. 目录 RuntimeWarning:Glyph 21435 missing from cur ...
- python出现中文乱码 RuntimeWarning: Glyph 24180 missing from current font.解决方法
文章目录 遇到的问题 解决方法 参考 解决方法:在画图前添加这样一句代码 plt.rcParams['font.sans-serif'] = ['SimHei'] 遇到的问题 环境:win10,编辑器 ...
- 错误RuntimeWarning: Glyph xxxxx missing from current font的产生原因解析,检测当前字体是否包含某字符
RuntimeWarning: Glyph xxxx missing from current font是matplotlib的经典错误. 原因大家都清楚:字体不匹配,显示不了对应的字符. 现象就是: ...
- python画图时,中文无法正常显示的问题,RuntimeWarning: Glyph 26631 missing from current font. font.set_text(s, 0, fl
python画图时,中文无法正常显示的问题,RuntimeWarning: Glyph 26631 missing from current font. font.set_text(s, 0, fla ...
- matplotlib解决中文乱码问题,或者RuntimeWarning: Glyph 20154 missing from current font.
matplotlib解决乱码问题 如图:为图表添加名称时报措,如何处理. 添加代码: from pylab import mplmpl.rcParams['font.sans-serif'] =[&q ...
- RuntimeWarning: Glyph 30452 missing from current font. matplotlib画图无法显示中文
matplotlib画图无法显示中文 RuntimeWarning: Glyph 30452 missing from current font. plt画图的title显示的中文是方括号 错误图: ...
- Matplotlib绘图显示缺少中文字体-RuntimeWarning: Glyph 8722 missing from current font.
pyplot 并不默认支持中文显示,也没有自带中文字体,因此需要自行下载所需字体,并修改 rcParams 参数来显示中文.下面以 SimHei (黑体)字体为例进行说明. 说明:系统环境为 Linu ...
- 出现RuntimeWarning: Glyph 39057 missing from current font.的解决办法:
出现RuntimeWarning: Glyph 39057 missing from current font.的解决办法: 在程序开头添加如下程序: import matplotlib as mpl ...
- Matplotlib绘图py:151: UserWarning: Glyph 27773 missing from current font.
Matplotlib绘图--中文乱码问题 在jupyter notebook 中,使用 Matplotlib 绘图过程中涉及了中文字符,出现警告 E:\Anaconda\lib\site-packag ...
最新文章
- 杨子见歧路而哭之——有的路必须自己去走
- JS格式化JSON串显示在表格中
- rust(26)-单元类型与never
- java创建类的三个步骤_3个简单步骤即可测试Java 8
- colorpix取色小工具_五款互联网人必备的免费工具,超级实用
- 手写及场景文字分析与识别的一些新尝试
- nginx 和tomcat,apache的区别于联系。
- java 自己写一个模板_写一个java生成模板
- python网络编程相关
- 这款机器人也想体验双十一!
- 基于单片机PID电机调速控制设计-基于单片机LED条屏显示温度和时间设计-基于单片机PM2.5雾霾检测处理控制设计-基于单片机SHT11温湿度采集报警系统设计-基于单片机8155秒表计时器系统设计
- linux 编辑 iso文件格式,这两款实用的光盘映像文件制作编辑软件让你处理ISO文件易如反掌...
- Spark3.0新特性-AQE
- 路由器 OSPF 路由汇总配置
- Ruby_01_环境安装
- 论如何在网页中插入一张图片
- java 正则表达式匹配冒号_java 获取冒号后面的参数(正则)实现代码
- CSS 背景(background)+背景透明(CSS3)
- tar 解压缩命令~
- CDH6.3.1监控界面Hive修改参数