pyplot - 负数显示不正确

3
当我将默认字体更改为“Times New Roman”时,负数未正确显示。我想知道问题所在以及如何解决。我使用 plt.rcParams["font.family"] = "Times New Roman" 或者 plt.rc('font',family='Times New Roman')。下面分别是默认字体和新字体的图片。 enter image description here enter image description here

看起来matplotlib没有使用减号,而是使用破折号(或类似的符号)。 - Willem Van Onsem
plt.rcParams['axes.unicode_minus'] 是什么? - Willem Van Onsem
@WillemVanOnsem,它起作用了!非常感谢。 - Shannon
1个回答

7
如@WillemVanOnsem在下面的原始问题评论中提到的那样,可以使用plt.rcParams['axes.unicode_minus'] = False来解决该问题。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接