[python] Display Chinese normally; display negative sign

plt.rcParams['font.sans-serif'] = ['SimHei']  # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False  # 用来正常显示负号

Not present
plt.rcParams[‘font.sans-serif’] = [‘SimHei’]
Insert image description here
Result 1: No Chinese

Just available
plt.rcParams[‘font.sans-serif’] = [‘SimHei’]
Insert image description here
Result 2: There is Chinese, no negative sign

加上
plt.rcParams[‘axes.unicode_minus’] = False
Insert image description here
Result 3: There is Chinese and there is a negative sign

Guess you like

Origin blog.csdn.net/qq_50653422/article/details/134792192