Adding close() to end of figures