matplotlib绘图报错138: UserWarning: Glyph 8722 (\N{MINUS SIGN}) missing from current font.

BeyondTechnology / 2023-08-30 / 原文

 

解决方法

#给matplotlib指定中文字体

matplotlib.rcParams['font.family'] = 'SimHei'

#正常显示坐标轴负号
matplotlib.rcParams['axes.unicode_minus'] = False