Description
I think that it would be useful to have a third interactive mode. It already kind of exist when %matplotlib
attach the _needmain
attribute to plt.show
but it is kind of hacky because of the need for a try block and there is no information about the property in pyplot
.
I want the plt.show()
behavior when %matplotlib
has been used without the need to use IPython or %matplotlib
because I don't think that it make sense to let plt.show()
block by default in an interactive python session.
In detail I propose the following:
- non-interactive mode
-plt.show() block by default - in between mode
- as non-interactive mode with the difference that plt.show() don't block by default.
- interactive mode as it is today.
This would result in a consistent behavior between vanilla python and IPython with and without %matplotlib.
This can of course also just be a property on plt.show
.
I believe this would be useful when running the same scripts in different ways so that you don't need to change the plt.show
block
parameter. The problematic case is if you want to run python interactively but matplotlib non-interactive. Then is it necessary to use plt.show(False)
to get expected behavior and change this if you want to run the same script in non-interactive python.
It might even be possibly to get this behavior by default if matplotlib knows if the python session is interactive or not.