I have a python program, say, train.py
. It can be run in anaconda prompt by typing:
python train.py
In train.py
, some part is written for drawing and saving figures:
import matplotlib.pyplot as plt
....... #I omit these codes
plt.savefig(....)
plt.show() #this will produce a figure window
plt.close()
In implementing the program, some figures are to be generated, which will bring the program to a temporary halt, even though plt.close()
present. Then I need to manually close the pop-up figure window due to plt.show()
and continue the program. How to avoid this inconvenience.
It is noted that spyder
can run the program continuously, with figures displayed in its console.