close figures to save memory