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

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 matplotlib RuntimeWarning: Glyph xxxxx missing from current font.字体设置问题_第1张图片

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

你可能感兴趣的:(python matplotlib RuntimeWarning: Glyph xxxxx missing from current font.字体设置问题)