问题:UserWarning: Glyph 29992 (\N{CJK UNIFIED IDEOGRAPH-7528}) missing from font(s) DejaVu Sans.
FigureCanvasAgg.draw(self)
解决办法:
在表头添加如下代码:
import matplotlib.pyplot as plt
import matplotlib
# 设置字体为SimHei,确保该字体在你的系统中存在
matplotlib.rcParams['font.sans-serif'] = ['SimHei'] # 指定默认字体
matplotlib.rcParams['axes.unicode_minus'] = False # 解决保存图像时负号'-'显示为方块的问题
如果系统没有安装SimHei字体,可以参考这篇文章进行下载安装:https://blog.csdn.net/qq_56079620/article/details/139451367