Python Matplotlib: How to close a plot?

Hi there!
I need to know how to close a figure/chart in matplot.
The problem is: I am developing a program that calculates >5 figures and
needs some minutes to calculate one. So it would be great if I could close
the figure if the next figure is ready cause then I am able to show both
figures and so on.....

Does anyone know how it works and could you explain on the below example?

import matplotlib.pyplot as plt
import time

fig = plt.figure(1)
ax = fig.add_subplot(111)
ax.plot((1, 3, 1))
plt.draw()

fig = plt.figure(2)
ax = fig.add_subplot(111)
ax.plot((4, 1, 0))

plt.show()

time.sleep(10)

plt.close(1)

···


View this message in context: http://old.nabble.com/Python-Matplotlib%3A-How-to-close-a-plot--tp27485059p27485059.html
Sent from the matplotlib - users mailing list archive at Nabble.com.