使用matplotlib画图时常会遇到汉字无法正常显示的情况,如下图: 只需在绘图前添加以下代码: matplotlib.rcParams['font.sans-serif'] = ['KaiTi'] 即可正常绘图。