Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jklymak merged 2 commits intomatplotlib:mainfromgreglucas:macosx-savefig
May 18, 2022

Conversation

greglucas
Copy link
Contributor

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

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@greglucasgreglucas added this to thev3.6.0 milestoneJan 10, 2022
@@ -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'])
Copy link
Member

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?

Copy link
ContributorAuthor

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...

Copy link
ContributorAuthor

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. Ithink that should get codecov for the Python branches at least... Still not testing the Objective-C updates, but better than nothing?

dstansby reacted with thumbs up emoji
@greglucasgreglucasforce-pushed themacosx-savefig branch 2 times, most recently from647451d tobd7d627CompareJanuary 10, 2022 16:25
@greglucasgreglucas requested a review fromdstansbyMarch 5, 2022 18:17
This adds the rcParams savefig.directory option into the macosxbackend for the savefig dialog window.
@greglucas
Copy link
ContributorAuthor

Ping for a review from any mac users that want to test this out.

@greglucas
Copy link
ContributorAuthor

@dstansby / mac users, reminder for another review on this one as well.

  • You should be able to set the savefig directory with rcParams now
  • The previously saved directory should be the default directory upon a second save figure request. (Save to /tmp the first time, and then the next time it should bring up /tmp as the default save location)

@jklymakjklymak merged commitdd001ed intomatplotlib:mainMay 18, 2022
@QuLogicQuLogic mentioned this pull requestSep 9, 2022
2 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@tacaswelltacaswelltacaswell approved these changes

@jklymakjklymakjklymak approved these changes

@dstansbydstansbyAwaiting requested review from dstansby

Assignees
No one assigned
Projects
None yet
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

[ENH]: macosx backend does not respect rcParams["savefig.directory"]
5 participants
@greglucas@tacaswell@QuLogic@jklymak@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp