如下所示:

plt.rcParams['savefig.dpi'] = 300 #图片像素
plt.rcParams['figure.dpi'] = 300 #分辨率

为了记住不忘 发一下博客常看常记。

位置在plt.show之前就可以