Repository: matplotlib/matplotlib

Issue #18314: savefig.directory could get updated even if it is initially empty.
Created: 2020-08-21T17:18:07Z
Problem
rcParams["savefig.directory"] sets the default directory used by the figure-saving dialog.  It is either a fixed firectory (defaulting to $HOME), or, if an empty string, uses the current directory of the process.  After saving a figure, its value gets updated to the directory where that figure was saved (so if it starts at /foo/bar but you interactively select to save a figure as /quux/baz.png, next time you click on the figure-saving icon the dialog will start at /quux)... except if the initial value is the empty string (i.e., the current directory) in which case later dialogs will still start at the current directory.
I have indeed set savefig.directory to be empty, as I quite often want to save figures "close" to the script directory; however, if I want e.g. to put multiple figures in the same subdirectory or sibling directory, then I need to interactively do so for each figure, which is a lot of clicking.
Proposed Solution
Hence, at least for this use case, it would be reasonable to always update savefig.directory after an interactive save, even if its initial value is empty.  I guess this may (like always) break some workflows(?!) -- although that seems slightly unlikely to me --, so we may possibly just put the decision of whether to ever update that rcParam into yet another separate rcParam (savefig.update_directory_after_save)... or we may decide it's not worth that additional complexity unless someone actually complains ;-)
Additional context and prior art

Duplicate issue #18315: savefig.directory could get updated even if it is initially empty.
Created: 2020-08-21T17:21:16Z
Problem
rcParams["savefig.directory"] sets the default directory used by the figure-saving dialog.  It is either a fixed firectory (defaulting to $HOME), or, if an empty string, uses the current directory of the process.  After saving a figure, its value gets updated to the directory where that figure was saved (so if it starts at /foo/bar but you interactively select to save a figure as /quux/baz.png, next time you click on the figure-saving icon the dialog will start at /quux)... except if the initial value is the empty string (i.e., the current directory) in which case later dialogs will still start at the current directory.
I have indeed set savefig.directory to be empty, as I quite often want to save figures "close" to the script directory; however, if I want e.g. to put multiple figures in the same subdirectory or sibling directory, then I need to interactively do so for each figure, which is a lot of clicking.
Proposed Solution
Hence, at least for this use case, it would be reasonable to always update savefig.directory after an interactive save, even if its initial value is empty.  I guess this may (like always) break some workflows(?!) -- although that seems slightly unlikely to me --, so we may possibly just put the decision of whether to ever update that rcParam into yet another separate rcParam (savefig.update_directory_after_save)... or we may decide it's not worth that additional complexity unless someone actually complains ;-)
Additional context and prior art

Closing comment (2020-08-21T18:07:17Z): Duplicate of #18314.