繁体   English   中英

Matplotlib:无法在spyder中关闭交互模式

[英]Matplotlib : cannot turn off interactive mode in spyder

来自doc关于交互模式

使用此代码:

import matplotlib.pyplot as plt
plt.ioff()
plt.plot([1.6, 2.7])
plt.show()

show()调用应该阻塞,直到我关闭图形。 但事实并非如此, show()不会阻止执行。 当我的图形仍然显示时,我可以向IPython shell添加一些代码。

Python 3.7.0 (default, Jun 28 2018, 08:04:48) [MSC v.1912 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 6.5.0 -- An enhanced Interactive Python.

我的后端是“ Qt5Agg”

我在另一个python env(来自Cygwin)上测试了此代码:它完美无缺。

您可以通过以下方式关闭对matplotlib的支持:

Tools/Preferences/IPython Console/Graphics/Support for graphics(Matplotlib)/Activate support

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM