matplotlib.plot.show always blocks the execution of python script

lampahome pahome.chen at mirlab.org
Thu Nov 1 05:29:04 EDT 2018


I want to plot a graph and *still run following code without closing the
graph automatically like Matlab does*.

I try plt.show(block=False) , it failed and appear in a small moment then
close itself.

I also try plt.draw() or interactive mode , it failed, too.
plt.draw() will block until I close it.
interactive mode and plot.show() will appear nothing

My version is below:
user at ya:~/$ sudo pip freeze | grep matplotlib
matplotlib==2.2.3
user at ya:~/$ sudo pip -V
pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

Environments:
I only execute script in Ubuntu ex: user at ya: python xxx.py Distributor ID:
Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial

Can anyone help me? I just want to do like Matlab which won't close the
plotted graph even if the script finishes.



More information about the Python-list mailing list