本文主要是介绍解决python Matplotlib绘图中文字体乱码问题_centos,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在使用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_
这篇关于解决python Matplotlib绘图中文字体乱码问题_centos的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!