-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: Use rcParams savefig.directory on macosx backend #22180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -104,10 +106,15 @@ def remove_rubberband(self): | |||
self.canvas.remove_rubberband() | |||
|
|||
def save_figure(self, *args): | |||
directory = os.path.expanduser(mpl.rcParams['savefig.directory']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to add a smoke test for this in the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I think this is another PR that would be quite hard to add a test for because it is using the GUI :( I did a global search and didn't see any of the other backends testing this either...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take that back, I just pushed up a test to hijack the GUI function and return a well-defined string instead. I think that should get codecov for the Python branches at least... Still not testing the Objective-C updates, but better than nothing?
647451d
to
bd7d627
Compare
This adds the rcParams savefig.directory option into the macosx backend for the savefig dialog window.
bd7d627
to
9ed0a30
Compare
9ed0a30
to
15afb44
Compare
Ping for a review from any mac users that want to test this out. |
@dstansby / mac users, reminder for another review on this one as well.
|
PR Summary
This adds the rcParams savefig.directory option into the macosx
backend for the savefig dialog window.
Additionally cleans up some of the UTF8 string allocations in this code block.
Closes #21710
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).