简体   繁体   中英

Matplotlib : cannot turn off interactive mode in spyder

From doc about interactive mode

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. But it doesn't, show() does not block execution. I can add some code to IPython shell while my figure still displayed.

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'

I tested this code on another python env (from Cygwin): it works flawlessly.

You can turn off support for matplotlib via

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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