代码示例:
import sys
import matplotlib.pyplot as plot
if 'win' in sys.platform:
plot.rcParams['font.sans-serif'] = ['Songti SC'] # 用来正常显示Windows中文标签
else:
plot.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示MacOS中文标签
# 显示负数符号
plot.rcParams['axes.unicode_minus'] = False