use plt.close() to clear figures in memory