解决 Matplotlib 'Glyph missing from current font' 警告
这个警告通常是由于绘图中使用了当前字体不支持的字符导致的。如果你不关心警告,可以忽略它。如果你想消除警告,可以尝试更换字体,或者使用 Unicode 字符代码替代特定字符。具体方法可以参考以下链接:
- https://stackoverflow.com/questions/46936047/how-do-i-resolve-the-warning-glyph-missing-from-current-font-in-matplotlib
- https://matplotlib.org/stable/users/usetex.html#font-recommendations
如果你不确定如何更换字体,可以在绘图代码中添加以下行:
import matplotlib
print(matplotlib.rcParams['font.family'])
这将输出当前使用的字体系列。你可以在 matplotlib 配置文件中查找可用字体,或者在系统中安装新字体。
原文地址: https://www.cveoy.top/t/topic/n32i 著作权归作者所有。请勿转载和采集!