Tutorial by Examples

The pyplot interface to matplotlib might be the simplest way to close a figure. import matplotlib.pyplot as plt plt.plot([0, 1], [0, 1]) plt.close()
A specific figure can be closed by keeping its handle import matplotlib.pyplot as plt fig1 = plt.figure() # create first figure plt.plot([0, 1], [0, 1]) fig2 = plt.figure() # create second figure plt.plot([0, 1], [0, 1]) plt.close(fig1) # close first figure although second one is active ...

Page 1 of 1