matplotlib/matplotlib — pull request #1685 by mspacek (2013-01-19 01:36:05+00:00)
Title: add default savefig directory

A while ago, we added the ability to supply the default filename to the savefig dialog. That was handy. But, I find when I'm generating figures, I'm usually saving them all to the same directory. Having to constantly navigate there from the current working directory that the Python code is running in is very tedious. This PR saves the last used savefig directory, and fills that into the savefig dialog next time you try to save a figure. This is remembered for the duration of the current Python session by updating a savefig.directory key in the rcParams dict. This PR also adds savefig.directory to the matplotlibrc file, so you can control what the initial default is when you try and save a figure for the first time in your Python session.

I've only added this to Qt4 figures, since that's the only GUI backend I ever use. Perhaps other GUI backends should get this too? I'd prefer it if someone could branch my savefig_directory branch and provide that code, since I'm only really familiar with Qt4.