Is there a way for a python script to run to completion while backgrounding a matplotlib
plot? The code below will block until the plot is closed.
import matplotlib
from matplotlib import pyplot as plt
x = [0,1,2,3,4]
plt.plot(x)
plt.show()
Setting plt.show(block=False)
prevents the plot from ever showing up.
Clarification on running:
From a linux shell, running python example.py
, which contains the code above, should run and return to the linux prompt while the plot stays up. Currently the plot will block the completion of the python script.