首页 > 其他 > 详细

plt.close()不work

时间:2021-01-20 17:31:39      阅读:33      评论:0      收藏:0      [点我收藏+]

成功解决plt.close()不work

原因:

Remember that plt.show() is a blocking function, so in the example code you used above, plt.close() isn‘t being executed until the window is closed, which makes it redundant.
You can use plt.ion() at the beginning of your code to make it non-blocking, although this has other implications.

解决方案:

在作图代码前加上plt.ion(),成功解决。

reference:

https://stackoverflow.com/questions/20401057/matplotlib-close-does-not-close-the-window

plt.close()不work

原文:https://www.cnblogs.com/blog-joy/p/14303605.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!