[转]错误RuntimeWarning: Glyph xxxxx missing from current font的产生原因分析,无法解析当前字体

本文详细解析了在MacOS和Python 3.9.1环境中遇到的RuntimeWarning: Glyph缺失错误,重点介绍了如何通过设置字体路径、下载并安装SimHei字体、清理matplotlib缓存以及修改matplotlibrc文件来解决中文显示问题。

错误RuntimeWarning: Glyph xxxxx missing from current font的产生原因分析,无法解析当前字体
oneLC
于 2021-01-17 11:59:57 发布 5477
收藏 29
文章标签: python 乱码
版权
错误RuntimeWarning: Glyph xxxxx missing from current font的产生原因分析,无法解析当前字体

系统版本:macOS11,

python版本:python3.9.1

报错原因:matplotlib中文乱码问题

解决办法:

1、在终端python 的环境下,查看字体路径

    import matplotlib    
    print(matplotlib.matplotlib_fname())

2、下载SimHei(也可下载其他支持中文字体)

百度搜索任意下载网站下载需要的字体

并前往指定目录: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/ttf ,将下载好的SimHei移动到该目录下。

3、删除matplotlib的缓冲目录
在终端python 的环境下,输入如下指令,查看matplotlib的字体缓存路径:

    import matplotlib
    matplotlib.get_cachedir()

然后退出python环境,在终端使用 rm -rf +路径 删除缓存目录

4、修改matplotlibrc文件
修改/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc,修改内容如下:

     font.family         : sans-serif   
     # 去掉前面的#     
     font.sans-serif     : SimHei, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif  
     # 去掉前面的#,并在冒号后面添加SimHei
     axes.unicode_minus  : False
     # 去掉前面的#,并将True改为False

5、完成字体配置,可正常使用

 
————————————————
版权声明:本文为优快云博主「oneLC」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/weixin_45401712/article/details/112734987

C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0, flags=flags) all 223 223 0.999 1 0.995 0.995 223 96 0.999 1 0.995 0.995 223 127 0.999 1 0.995 0.995 C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:240: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0.0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23090 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 23130 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 26860 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37813 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 25779 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 32017 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 38338 missing from current font. font.set_text(s, 0, flags=flags) C:\Users\Administrator\anaconda3\envs\py38-v5\lib\site-packages\matplotlib\backends\backend_agg.py:203: RuntimeWarning: Glyph 37722 missing from current font. font.set_text(s, 0, flags=flags) 怎么处理
最新发布
08-06
图片汉字不显示并且===== 数据可视化 ===== D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26680 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24515 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 35780 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20998 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 32500 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24230 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24067 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21475 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21619 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 29615 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 22659 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26381 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21153 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21475 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21619 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 29615 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 22659 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26381 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21153 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20540 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 35780 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20998 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20540 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26680 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24515 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 32500 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24230 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24067 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24066 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 22330 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 28909 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25104 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26412 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25928 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 30410 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20154 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 22343 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 28040 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 36153 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20803 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20154 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 22343 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 28040 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 36153 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20803 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 28857 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25968 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 37327 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 28857 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25968 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 37327 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24066 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 22330 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 28909 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25104 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26412 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25928 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 30410 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 39184 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 39278 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25454 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26512 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21487 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 35270 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21270 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 39184 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 39278 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25454 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26512 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21487 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 35270 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21270 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21475 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21619 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 29615 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 22659 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26381 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21153 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 35780 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20998 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20540 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26680 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24515 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 32500 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24230 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24067 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20154 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 22343 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 28040 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 36153 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20803 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 28857 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25968 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 37327 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24066 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 22330 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 28909 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25104 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26412 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25928 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 30410 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 29305 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24449 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 30456 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 20851 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24615 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 26512 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 24215 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 38138 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 39184 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 39278 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 25454 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21487 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 35270 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:238: RuntimeWarning: Glyph 21270 missing from current font. font.set_text(s, 0.0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21475 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21619 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 29615 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 22659 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26381 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21153 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 35780 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20998 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20540 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26680 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24515 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 32500 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24230 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24067 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20154 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 22343 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 28040 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 36153 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20803 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 28857 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25968 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 37327 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24066 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 22330 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 28909 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25104 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26412 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25928 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 30410 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 29305 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24449 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 30456 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 20851 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24615 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 26512 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 24215 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 38138 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 39184 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 39278 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 25454 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21487 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 35270 missing from current font. font.set_text(s, 0, flags=flags) D:\zhhhhhhh\anaconda\lib\site-packages\matplotlib\backends\backend_agg.py:201: RuntimeWarning: Glyph 21270 missing from current font. font.set_text(s, 0, flags=flags)
06-16
<think>我们遇到了matplotlib生成图片时汉字显示为方框或提示"Glyphmissingfromcurrentfont"的问题。根据引用资料,这通常是因为matplotlib默认字体不支持中文。以下是几种解决方案:###方法1:设置全局字体(推荐)在代码开头设置matplotlib的字体参数,使用系统支持的中文字体(如SimHei、MicrosoftYaHei等):```pythonimportmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['SimHei']#使用黑体显示中文plt.rcParams['axes.unicode_minus']=False#正确显示负号```**注意**:此方法简单,但可能在某些系统(如Mac)上无效[^2]。###方法2:指定字体文件路径(更可靠)如果方法1无效,可以直接指定系统中已安装的中文字体文件路径:```pythonfrommatplotlib.font_managerimportFontProperties#指定字体文件路径(Windows系统常见中文字体路径)font_path='C:/Windows/Fonts/simhei.ttf'#黑体#font_path='C:/Windows/Fonts/msyh.ttc'#微软雅黑#创建字体属性对象chinese_font=FontProperties(fname=font_path)#在绘图时使用plt.xlabel('X轴标签',fontproperties=chinese_font)plt.ylabel('Y轴标签',fontproperties=chinese_font)plt.title('标题',fontproperties=chinese_font)```###方法3:临时修改单次绘图字体如果不想全局修改,可以在每次绘图时单独设置:```pythonplt.title('餐饮数据分析',fontdict={'family':'SimHei','size':16})```###方法4:查找并添加字体(跨平台方案)1.**查找已安装字体**:```pythonimportmatplotlib.font_managerasfm#查看所有已注册字体fonts=fm.findSystemFonts()chinese_fonts=[fforfinfontsif'hei'inf.lower()or'yahei'inf.lower()or'song'inf.lower()]print("可用中文字体:",chinese_fonts)```2.**动态加载字体**:```python#选择检测到的第一个中文字体ifchinese_fonts:font_prop=fm.FontProperties(fname=chinese_fonts[0])plt.title('使用动态加载的字体',fontproperties=font_prop)```###完整代码集成示例将字体解决方案集成到之前的预处理代码中:```python#-*-coding:utf-8-*-importpandasaspdimportnumpyasnpimportmatplotlibmatplotlib.use('Agg')#关键设置:确保在无GUI环境下生成图片importmatplotlib.pyplotaspltfrommatplotlib.font_managerimportFontProperties#新增字体管理importseabornassnsimportosimporttracebackfromsklearn.preprocessingimportStandardScaler#===中文字体解决方案===defset_chinese_font():"""设置中文字体,兼容Windows/Mac"""try:#方案1:全局设置SimHeiplt.rcParams['font.sans-serif']=['SimHei','DejaVuSans']#SimHei+备用字体plt.rcParams['axes.unicode_minus']=False#验证字体是否生效test_text="中文测试"plt.text(0.5,0.5,test_text,fontsize=12)plt.close()print("√全局中文字体设置成功")except:#方案2:指定字体文件路径try:#Windows字体路径win_fonts=['C:/Windows/Fonts/simhei.ttf',#黑体'C:/Windows/Fonts/msyh.ttc',#微软雅黑'C:/Windows/Fonts/simkai.ttf'#楷体]#Mac字体路径(示例)mac_fonts=['/System/Library/Fonts/PingFang.ttc',#苹方'/Library/Fonts/Microsoft/SimHei.ttf']#自动检测可用字体font_path=Noneforfontinwin_fonts+mac_fonts:ifos.path.exists(font):font_path=fontbreakiffont_path:#创建全局字体属性chinese_font=FontProperties(fname=font_path)plt.rcParams['font.family']=chinese_font.get_name()print(f"√通过字体文件设置中文字体:{font_path}")else:print("!警告:未找到系统中文字体文件,中文可能显示异常")exceptExceptionase:print(f"×字体设置失败:{str(e)}")#在main函数前调用字体设置set_chinese_font()#...(其余函数safe_visualization_save和main保持不变)...```###关键点说明:1.**字体选择**:-Windows常用字体:`SimHei`(黑体)、`MicrosoftYaHei`(微软雅黑)-Mac常用字体:`PingFangSC`(苹方)、`HiraginoSansGB`(冬青黑体)2.**兼容性处理**:-先尝试简单全局设置(方法1)-失败后自动检测系统字体文件(方法2)-提供跨平台路径检测(Windows/Mac)3.**验证机制**:-使用`plt.text()`绘制测试文本验证字体是否生效-捕获异常并降级处理4.**与可视化代码集成**:-在`main()`函数执行前设置字体-确保所有图表元素(标题、标签、图例)都能正确显示中文###常见问题排查:1.**字体名称错误**:使用`print(plt.rcParams['font.sans-serif'])`检查当前字体栈2.**字体文件损坏**:从正规渠道下载字体文件并重新安装3.**缓存问题**:删除matplotlib缓存(`~/.matplotlib`目录)4.**权限问题**:确保程序有权限读取字体文件###相关问题:1.如何在Linux服务器上配置matplotlib中文字体支持?2.如何批量修改已生成的图片中的字体?3.除了中文字体,matplotlib如何处理多语言文本(如日文、韩文)?4.在Docker容器中部署时如何解决字体缺失问题?5.如何将自定义字体嵌入matplotlib生成的PDF文件中?[^1]:引用自matplotlib中文显示解决方案[^2]:参考Mac系统下matplotlib中文显示问题处理[^3]:基于指定字体路径的解决方案[^4]:使用系统已安装字体的方法[^5]:全局字体参数设置方法</think># Matplotlib 汉字显示问题解决方案 遇到 "Glyph missing from current font" 错误时,表明 Matplotlib 无法找到合适的中文字体。以下是几种有效的解决方案: ## 1. 全局设置中文字体(推荐) ```python import matplotlib.pyplot as plt # 设置全局中文字体 plt.rcParams['font.sans-serif'] = ['SimHei', 'Microsoft YaHei', 'KaiTi', 'SimSun'] # 常用中文字体列表 plt.rcParams['axes.unicode_minus'] = False # 解决负号显示问题 ``` **优点**:一次性解决所有图表的中文显示问题 **缺点**:需要系统已安装这些字体 ## 2. 指定字体文件路径(最可靠) ```python import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties # 指定字体文件路径 font_path = 'C:/Windows/Fonts/simhei.ttf' # 黑体 # font_path = 'C:/Windows/Fonts/msyh.ttc' # 微软雅黑 # 创建字体属性 chinese_font = FontProperties(fname=font_path) # 使用字体 plt.title('标题', fontproperties=chinese_font, fontsize=14) plt.xlabel('X轴标签', fontproperties=chinese_font) plt.ylabel('Y轴标签', fontproperties=chinese_font) ``` ## 3. 动态查找可用字体 ```python import matplotlib.font_manager as fm import matplotlib.pyplot as plt # 查找系统支持的中文字体 chinese_fonts = [f.name for f in fm.fontManager.ttflist if any(char in f.name for char in '宋黑楷') and 'CN' in f.name] if chinese_fonts: plt.rcParams['font.sans-serif'] = chinese_fonts[:3] # 使用前三种找到的字体 plt.rcParams['axes.unicode_minus'] = False print(f"√ 使用中文字体: {chinese_fonts[:3]}") else: print("! 警告: 未找到中文字体,将使用默认字体") ``` ## 4. 修改 matplotlibrc 配置文件(永久解决方案) 1. 查找配置文件位置: ```python import matplotlib as mpl print(mpl.matplotlib_fname()) # 输出配置文件路径 ``` 2. 编辑此文件,添加以下内容: ``` font.family : sans-serif font.sans-serif : SimHei, Microsoft YaHei, KaiTi, SimSun axes.unicode_minus : False ``` ## 完整代码集成示例 ```python import matplotlib matplotlib.use('Agg') # 解决无GUI环境问题 import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties import seaborn as sns import pandas as pd import numpy as np # 中文字体解决方案 def set_chinese_font(): """设置中文字体显示""" try: # 尝试全局设置 plt.rcParams['font.sans-serif'] = ['SimHei', 'Microsoft YaHei'] plt.rcParams['axes.unicode_minus'] = False # 测试字体是否生效 plt.figure() plt.text(0.5, 0.5, "中文测试", fontsize=12) plt.close() print("√ 全局中文字体设置成功") except: # 失败则使用字体文件 try: # Windows字体路径 win_fonts = [ 'C:/Windows/Fonts/simhei.ttf', # 黑体 'C:/Windows/Fonts/msyh.ttc', # 微软雅黑 'C:/Windows/Fonts/simkai.ttf' # 楷体 ] # 查找第一个可用的字体文件 font_path = next((f for f in win_fonts if os.path.exists(f)), None) if font_path: # 创建全局字体属性 chinese_font = FontProperties(fname=font_path) plt.rcParams['font.family'] = chinese_font.get_name() print(f"√ 通过字体文件设置中文字体: {font_path}") else: print("! 警告: 未找到系统中文字体文件") except Exception as e: print(f"× 字体设置失败: {str(e)}") # 在绘图前调用字体设置 set_chinese_font() # 示例绘图代码 df = pd.DataFrame({ '类别': ['中餐', '西餐', '日料', '快餐'], '销售额': [120, 85, 65, 110] }) plt.figure(figsize=(10, 6)) sns.barplot(x='类别', y='销售额', data=df, palette='viridis') plt.title('各类别餐厅销售额对比', fontsize=15) plt.xlabel('餐厅类别', fontsize=12) plt.ylabel('销售额 (万元)', fontsize=12) # 保存到桌面 plt.savefig(os.path.join(os.environ['USERPROFILE'], 'Desktop', 'restaurant_sales.png'), bbox_inches='tight', dpi=150) print("√ 图表已保存到桌面") ``` ## 常见问题排查 1. **字体名称错误**: ```python # 查看所有可用字体 import matplotlib.font_manager as fm print([f.name for f in fm.fontManager.ttflist]) ``` 2. **字体文件位置错误**: - Windows 字体路径:`C:\Windows\Fonts\` - Mac 字体路径:`/Library/Fonts/` 或 `~/Library/Fonts/` 3. **缓存问题**: ```python # 清除matplotlib缓存 import matplotlib as mpl mpl.rcParams.update(mpl.rcParamsDefault) # 重置配置 ``` 4. **环境变量问题**: ```python # 设置matplotlib数据路径 import matplotlib as mpl mpl.rcParams['datapath'] = '/path/to/custom/font/directory' ``` ## 相关问题 1. 如何在 Linux 服务器上配置 Matplotlib 中文字体支持?[^1] 2. Matplotlib 生成 PDF 文件时中文显示异常如何解决?[^3] 3. 如何将自定义字体嵌入到 Matplotlib 生成的图表中?[^3] 4. Seaborn 图表中的中文显示问题有哪些特殊处理方式?[^2] 5. 如何解决 Jupyter Notebook 中 Matplotlib 中文显示问题?[^5] [^1]: 引用自 matplotlib 中文显示解决方案 [^2]: 参考 Mac 系统下 matplotlib 中文显示问题处理 [^3]: 基于指定字体路径的解决方案 [^4]: 使用系统已安装字体的方法 [^5]: 全局字体参数设置方法
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值