Matplotlib 问题
Matplotlib 生成数据轴上的标题设置成中文为什么不显示啊,有大佬晓得么,报错如下:Warning (from warnings module):
File "E:\python\lib\site-packages\matplotlib\backends\backend_agg.py", line 201
font.set_text(s, 0, flags=flags)
RuntimeWarning: Glyph 26041 missing from current font.
是不是我的matplotlib的下载包没有下完整啊,如果是下载包问题,麻烦大佬帮忙提供下Matplotlib3.9的下载包,谢谢! 当前字体缺少26041字型,设置下字体
matplotlib.rcParams['font.family'] = 'sans-serif'
matplotlib.rcParams['font.sans-serif'] = 'NSimSun,Times New Roman'
matplotlib 默认情况下是不支持中文显示的,需要我们进行设置,添加下面这行代码一般就能正常显示中文了:
# 设置中文字体
plt.rcParams['font.sans-serif'] = ['SIMHEI']
可以看看我这里总结 matplotlib 的帖子,都是一些基础操作,可能有助于你的学习哈:
【爬取鱼C 3W+ 条数据】通过 Pandas & Matplotlib 简单的处理数据和绘制的图表
https://fishc.com.cn/thread-170582-1-1.html
页:
[1]