Why isn't the default directory of savefig() the folder where the file is?

No. The location of the data has nothing to do with the location of the code, especially not with the top level file currently being evaluated. We provide @__FILE__ and @__DIR__ when you have a script that operate only on a project specific hard coded relative path.

1 Like