0

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.

1 Answer 1

1

You can turn off support for matplotlib via

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

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Deactivating matplotlib support does not solve this issue
It works fine for me. Did you restart spyder after changing that option? Also maybe you can spend some more words on how you run that code? (I'm assuming here that the code you show is a file in the spyder editor and is run via F5 or Run/Run)
I double checked, it does not solve my issue. Either when running code from file or from ipython, show does not block with given code. Strange issue.
Do you have anything filled in under "Startup"? Also your spyder version might be of interest.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.