其实,只需要在plt.savefig()函数中,加入一个参数。即plt.savefig(“path”, bbox_inches=‘tight’),可以得到此效果
https://blog.csdn.net/jifaley/article/details/79687000?utm_medium=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromMachineLearnPai2~default-2.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~BlogCommendFromMachineLearnPai2~default-2.control
https://blog.csdn.net/sinat_41617280/article/details/104889713?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_title~default-0.control&spm=1001.2101.3001.4242