Backport PR
#10186: Put savefig images back in source directory...
Backport PR
#10186: Put savefig images back in source directory
Simplifying the logic a bit.
I think there was an issue with the way we were finding the source directory: when it included a docstring from code, the source directory was that of the code. This always uses the main source directory of the docs.
Closes gh-8733