python matplotlib RuntimeWarning: Glyph xxxxx missing from current font.字体设置问题

编程入门 行业动态 更新时间:2024-10-26 12:23:42
D:\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py:180: RuntimeWarning: Glyph 26041 missing from current font.
  font.set_text(s, 0, flags=flags)
D:\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py:180: RuntimeWarning: Glyph 31243 missing from current font.
  font.set_text(s, 0, flags=flags)
D:\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py:180: RuntimeWarning: Glyph 22270 missing from current font.
  font.set_text(s, 0, flags=flags)
D:\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py:180: RuntimeWarning: Glyph 20687 missing from current font.
  font.set_text(s, 0, flags=flags)

这是错误提示,只需要补全下面代码就行(缺哪个补哪个)

from matplotlib import font_manager as fm, rcParams
import matplotlib as plt

plt.rcParams['font.sans-serif']=['SimHei'] #显示中文标签
plt.rcParams['axes.unicode_minus']=False   #这两行需要手动设置


之后就能正常显示啦

用python的第一个绘图作业^ _ ^

更多推荐

python matplotlib RuntimeWarning: Glyph xxxxx missing from current font.字体设置问

本文发布于:2023-06-14 01:18:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1422019.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体   RuntimeWarning   Glyph   python   matplotlib

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!