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.相关推荐

  1. RuntimeWarning:Glyph 21435 missing from current font.

    RuntimeWarning:Glyph 21435 missing from current font. 目录 RuntimeWarning:Glyph 21435 missing from cur ...

  2. python出现中文乱码 RuntimeWarning: Glyph 24180 missing from current font.解决方法

    文章目录 遇到的问题 解决方法 参考 解决方法:在画图前添加这样一句代码 plt.rcParams['font.sans-serif'] = ['SimHei'] 遇到的问题 环境:win10,编辑器 ...

  3. 错误RuntimeWarning: Glyph xxxxx missing from current font的产生原因解析,检测当前字体是否包含某字符

    RuntimeWarning: Glyph xxxx missing from current font是matplotlib的经典错误. 原因大家都清楚:字体不匹配,显示不了对应的字符. 现象就是: ...

  4. 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 ...

  5. matplotlib解决中文乱码问题,或者RuntimeWarning: Glyph 20154 missing from current font.

    matplotlib解决乱码问题 如图:为图表添加名称时报措,如何处理. 添加代码: from pylab import mplmpl.rcParams['font.sans-serif'] =[&q ...

  6. RuntimeWarning: Glyph 30452 missing from current font. matplotlib画图无法显示中文

    matplotlib画图无法显示中文 RuntimeWarning: Glyph 30452 missing from current font. plt画图的title显示的中文是方括号 错误图: ...

  7. Matplotlib绘图显示缺少中文字体-RuntimeWarning: Glyph 8722 missing from current font.

    pyplot 并不默认支持中文显示,也没有自带中文字体,因此需要自行下载所需字体,并修改 rcParams 参数来显示中文.下面以 SimHei (黑体)字体为例进行说明. 说明:系统环境为 Linu ...

  8. 出现RuntimeWarning: Glyph 39057 missing from current font.的解决办法:

    出现RuntimeWarning: Glyph 39057 missing from current font.的解决办法: 在程序开头添加如下程序: import matplotlib as mpl ...

  9. Matplotlib绘图py:151: UserWarning: Glyph 27773 missing from current font.

    Matplotlib绘图--中文乱码问题 在jupyter notebook 中,使用 Matplotlib 绘图过程中涉及了中文字符,出现警告 E:\Anaconda\lib\site-packag ...

最新文章

  1. 杨子见歧路而哭之——有的路必须自己去走
  2. JS格式化JSON串显示在表格中
  3. rust(26)-单元类型与never
  4. java创建类的三个步骤_3个简单步骤即可测试Java 8
  5. colorpix取色小工具_五款互联网人必备的免费工具,超级实用
  6. 手写及场景文字分析与识别的一些新尝试
  7. nginx 和tomcat,apache的区别于联系。
  8. java 自己写一个模板_写一个java生成模板
  9. python网络编程相关
  10. 这款机器人也想体验双十一!
  11. 基于单片机PID电机调速控制设计-基于单片机LED条屏显示温度和时间设计-基于单片机PM2.5雾霾检测处理控制设计-基于单片机SHT11温湿度采集报警系统设计-基于单片机8155秒表计时器系统设计
  12. linux 编辑 iso文件格式,这两款实用的光盘映像文件制作编辑软件让你处理ISO文件易如反掌...
  13. Spark3.0新特性-AQE
  14. 路由器 OSPF 路由汇总配置
  15. Ruby_01_环境安装
  16. 论如何在网页中插入一张图片
  17. java 正则表达式匹配冒号_java 获取冒号后面的参数(正则)实现代码
  18. CSS 背景(background)+背景透明(CSS3)
  19. tar 解压缩命令~
  20. CDH6.3.1监控界面Hive修改参数

热门文章

  1. 人力资源管理专业知识与实务(初级)【4】
  2. 分时系统用户可以独占计算机资源,资源共享分时系统
  3. Linux 解析 ip 的各种命令
  4. 蓝牙 韦东山_韦东山生活实例演绎法讲解蓝牙
  5. 一场积极的变革,期待着与5G的精彩邂逅
  6. phpstudy宝塔_宝塔和phpstudy的区别
  7. html5如何快速选择工具,PS抠图教程!教你PHOTOSHOP中5个快速选择工具
  8. MACD、SAR、KDJ、DBCD
  9. VC6link卡死解决办法
  10. html控制checkbox选中状态,怎么设置checkbox 选中状态