Matplotlib Savefig will NOT overwrite old files

TLDR: The photos WERE being overwritten, but the date was kept the same as the original file, due to a quirk of windows when a folder has lots of photos.

Jon’s answer from 10/2/2015 did the trick for me.
https://superuser.com/questions/147525/what-is-the-date-column-in-windows-7-explorer-it-matches-no-date-column-from/335901#335901

Basically windows detects lots of pictures in a folder and “optimizes” said folder for pictures. This means the column displayed is Date rather than Date Modified as it would be for a folder “optimized” for documents. Date takes the earlier of Date Created and Date Modified. As Date Created doesn’t change when matplotlib .savefig overwrites a file the Date column never changes.

To resolve this issue I customized the folder for documents. To do this select the folder and open the properties window. Navigate to the customize tab then select documents under “optimize this folder for.”

Leave a Comment

tech