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

Resolving: Add setter/getter methods for all keyword parameters to Figure.__init__ (Issue: #24617)#27531

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

Draft
zaheerhashmi wants to merge9 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromzaheerhashmi:zaheerhashmi_getter_setter_figure

Conversation

zaheerhashmi
Copy link

PR summary

This PR adds aliasing for layout, figsize and adds getter and setter methods for subplotparams.
Itresolves#24617. The PR utilized#21549 and#25901.

PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@zaheerhashmizaheerhashmi marked this pull request as draftDecember 17, 2023 01:26
@@ -48,7 +51,7 @@
import matplotlib.image as mimage

from matplotlib.axes import Axes
from matplotlib.gridspec import GridSpec, SubplotParams
from matplotlib.gridspec import GridSpec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why did this need to come back?

@@ -1291,6 +1354,65 @@ def subplots_adjust(self, left=None, bottom=None, right=None, top=None,
ax._set_position(ax.get_subplotspec().get_position(self))
self.stale = True

def set_subplotpars(self, subplotparams={}):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Default values should not be mutable objects like a dictionary. You should set it toNone, and then check that in the function.

Suggested change
defset_subplotpars(self,subplotparams={}):
defset_subplotpars(self,subplotparams=None):

Comment on lines +1389 to +1392
else:
_api.warn_external(
f"'{key}' is not a valid key for set_subplotpars;"
" this key was ignored.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

As a new function, this should be an error, not a warning.

Comment on lines +1397 to +1398
if kwargs == {}:
self.set_subplotpars(self.get_subplotpars())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't understand what this is doing?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[ENH]: Add setter/getter methods for all keyword parameters to Figure.__init__
2 participants
@zaheerhashmi@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp