Close Open File Python With Matplotlib