file_name = './aa/img' + str(i) + '.png'
plt.savefig(file_name)
更多可参考:
Python中读取,显示,保存图片的方法 - 珠峰上吹泡泡 - 博客园www.cnblogs.com python中利用matplotlib库所绘制图像的储存(绝对路径&相对路径)_weixin_44334176的博客-CSDN博客blog.csdn.net![93eb5c402b75fec7981fa511a1f720f9.png](https://img-blog.csdnimg.cn/img_convert/93eb5c402b75fec7981fa511a1f720f9.png)
在载入路径时往往需要用到os库
python将处理好的图像保存到指定目录下的方法_python_脚本之家www.jb51.net注:python文档
https://docs.python.org/3.7/docs.python.org及
https://docs.python.org/3.7/tutorial/index.htmldocs.python.org编程提问网站
https://stackoverflow.com/questions/45643650/importerror-no-module-named-cv2-python3?noredirect=1stackoverflow.commatplotlib库
Customizing Matplotlib with style sheets and rcParamsmatplotlib.org![fc37ab7c644fb97ce38ac61bb58a1e69.png](https://img-blog.csdnimg.cn/img_convert/fc37ab7c644fb97ce38ac61bb58a1e69.png)