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常遇到问题)