在使用python的matplotlib画图时,中文显示乱码,程序中使用的代码如下,
matplotlib.rcParams['font.family'] = 'SimHei'
执行之后程序报如下的错误,并且画出来的图中文显示乱码。
findfont: Font family ['SimHei'] not found. Falling back to DejaVu Sans.
/usr/local/lib64/python3.6/site-packages/matplotlib/backends/backend_agg.py:238: RuntimeWarning: Glyph 20154 missing from current font.
font.set_text(s, 0.0, flags=flags)
/usr/local/lib64/python3.6/site-packages/matplotlib/backends/backend_agg.py:238: RuntimeWarning: Glyph 20687 missing from current font.
font.set_text(s, 0.0, flags=flags)
/usr/local/lib64/python3.6/site-packages/matplotlib/backends/backend_agg.py:238: RuntimeWarning: Glyph 22812 missing from current font.
font.set_text(s, 0.0, flags=flags)
/usr/local/lib64/python3.6/site-packages/matplotlib/backends/backend_agg.py:238: RuntimeWarning: Glyph 2