RuntimeWarning:Glyph 21435 missing from current font.

目录

RuntimeWarning:Glyph 21435 missing from current font.

问题:

#解决:

#完整错误:


问题:

import pandas as pd
import numpy as np
import numpy as np
import pandas as pd
import matplotlib
%matplotlib inlineimport plotly as py
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
# import cufflinks as cf
# cf.go_offline()import matplotlib.pyplot as plt
import seaborn as snsdata = {'产品':['肉类','盐铁','纺织','木材']*2,'年份':[1046,1046,1046,1046,1047,1047,1047,1047],'诸侯':['秦','齐','楚','燕','赵','魏','韩','西周'],'产量':[180,140,300,200,150,60,80,320]}df=pd.DataFrame(data, columns=['产品','年份','诸侯','产量'])dfdef bar_plot(df,key):df[key].value_counts().sort_index().plot.bar(figsize = (12, 5),edgecolor = 'k', linewidth = 2)# Formattingplt.xlabel(key); plt.ylabel('COUNT'); plt.xticks(rotation = 60)plt.title('BAR PLOT for ' + key);bar_plot(df[:6],'产品')

RuntimeWarning:Glyph 21435 missing from current font.

#解决:

#其实本质是中文字体的问题咯,那么就配置字体就好了

#matplotlib

import matplotlib as mplmpl.rcParams['font.sans-serif'] = ['SimHei']
mpl.rcParams['font.serif'] = ['SimHei']

#seabron

sns.set_style('whitegrid',{'font.sans-serif':['SimHei','Arial']})

#完整错误:

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 21435 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 37325 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 21069 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 21518 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 22522 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 30784 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 20449 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning:

Glyph 24687 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 21435 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 37325 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 21069 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 21518 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 22522 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 30784 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 20449 missing from current font.

D:\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning:

Glyph 24687 missing from current font.

RuntimeWarning:Glyph 21435 missing from current font.相关推荐

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

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

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

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

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

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

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

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

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

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

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

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

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

  8. /backend_agg.py:238: RuntimeWarning: Glyph 26085 missing from current font.

    linux 使用python matplotlib画图时没有字体显示中文,导致中文乱码 字体下载链接: https://github.com/Heath-Ledger/WorkFile/blob/ma ...

  9. 使用matplotlib时报错:RuntimeWarning: Glyph 20998 missing from current font.

    matplotlib找不到字体,需要自行设置一下: 添加以下代码即可 plt.rcParams['font.sans-serif']=['SimHei']

最新文章

  1. hp laser103 属性没有配置项_冰雪传奇:起源之上还有装备吗?详解鸿蒙装备合成与属性...
  2. 不使用框架的web项目中配置log4j
  3. java web dao层_java web 中web层直接调用dao层 可以吗?
  4. nyist-组队赛(七)
  5. 修改数据表——添加约束(二十二)
  6. ThreadLocal的第二种用法 part1
  7. python子类定制_在Python中实现可定制的Lexer类
  8. C# COM Object for Use In JavaScript / HTML, Including Event Handling(转载)
  9. 铁威马NAS使用docker安装全网音乐教程
  10. JAVA百度贴吧签到器
  11. 大数据可视化平台Demo
  12. mysql 生日提醒
  13. 惠普服务器开机无限重启,电脑开机无限重启的解决方法
  14. 网络通信原理与IP地址的分配原理,网络七层由下往上分别为物理层、数据链路层、网络层、传输层、会话层、表示层和应用层
  15. Unity 游戏实例开发集合 之 CompoundBigWatermelon (简单合成一个大西瓜) 休闲小游戏快速实现
  16. 实时传输协议:RTP、RTCP、RTSP介绍
  17. bootstrap:导航栏【基础、简单、实用】
  18. 5款尽情歌唱的免费卡拉OK电脑软件
  19. java和连接数据库的驱动_java中连接各数据库的驱动类和连接方式
  20. ChatGPT 中文调教指南

热门文章

  1. 分享:Svg文件转换为图片(调用 Inkscape 命令行)
  2. 单链表-删除单链表L中第一个值为x的结点(双指针法)
  3. 12CSS中的盒子模型
  4. C# 中字符串string和字节数组byte[]的转换,16 进制字符串转 int的方法
  5. DETR3D:将DETR用于3D目标检测任务
  6. 一文让你搞懂YOLO难关!
  7. ICRA2021| 自动驾驶相关论文汇总
  8. ECCV2020超快车道线检测算法:Ultra Fast Structure-aware Deep Lane Detection
  9. OpenCV resize函数源码解析——加速方法
  10. formRef=React.createRef() this.formRef.current为null