python画出的图保存在了哪里 |
您所在的位置:网站首页 › 画图红包去哪了 › python画出的图保存在了哪里 |
1、使用matplotlib画图保存方法: 首先,import头文件如下:import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib.pyplot import plot,savefig 画图:fig, ax = plt.subplots(figsize=(12, 12)) ax.imshow(im, aspect='equal') #im是要显示的图像 保存图片:savefig("D:/1.jpg") 展示图片:plt.show() 2、turtle生成图片保存 代码示例如下:from Tkinter import * from turtle import * import turtle forward(100) ts = turtle.getscreen() ts.getcanvas().postscript(file="duck.eps") #.eps文件即postscript脚本 更多Python相关技术文章,请访问Python教程栏目进行学习! 以上就是python画图后怎么保存的详细内容,更多请关注php中文网其它相关文章! 本文原创发布php中文网,转载请注明出处,感谢您的尊重! |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |