简体   繁体   English

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

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

From doc about interactive mode 来自doc关于交互模式

With this code : 使用此代码:

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

show() call should block until I close the graph. show()调用应该阻塞,直到我关闭图形。 But it doesn't, show() does not block execution. 但事实并非如此, show()不会阻止执行。 I can add some code to IPython shell while my figure still displayed. 当我的图形仍然显示时,我可以向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.

My backend is 'Qt5Agg' 我的后端是“ Qt5Agg”

I tested this code on another python env (from Cygwin): it works flawlessly. 我在另一个python env(来自Cygwin)上测试了此代码:它完美无缺。

You can turn off support for matplotlib via 您可以通过以下方式关闭对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