Resolving: Add setter/getter methods for all keyword parameters to Figure.__init__ (Issue: #24617)#27531
Conversation
There was a problem hiding this comment.
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 us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
… init for the firgure class
|
|
||
| from matplotlib.axes import Axes | ||
| from matplotlib.gridspec import GridSpec, SubplotParams | ||
| from matplotlib.gridspec import GridSpec |
There was a problem hiding this comment.
Why did this need to come back?
| ax._set_position(ax.get_subplotspec().get_position(self)) | ||
| self.stale = True | ||
|
|
||
| def set_subplotpars(self, subplotparams={}): |
There was a problem hiding this comment.
Default values should not be mutable objects like a dictionary. You should set it to None, and then check that in the function.
| def set_subplotpars(self, subplotparams={}): | |
| def set_subplotpars(self, subplotparams=None): |
| else: | ||
| _api.warn_external( | ||
| f"'{key}' is not a valid key for set_subplotpars;" | ||
| " this key was ignored.") |
There was a problem hiding this comment.
As a new function, this should be an error, not a warning.
| if kwargs == {}: | ||
| self.set_subplotpars(self.get_subplotpars()) |
There was a problem hiding this comment.
I don't understand what this is doing?
|
We discussed issue #24617 in the weekly meeting yesterday, and the general opinion is that this issue needs refinement before it's actually actionable. For this reason, I will close all related open issues for now. This does not mean you can't open another PR in the future or that your solution is necessarily innapropriate, but this will help us focus our efforts. Thank you for your contribution and hope to see you around! |
PR summary
This PR adds aliasing for layout, figsize and adds getter and setter methods for subplotparams.
It resolves #24617. The PR utilized #21549 and #25901.
PR checklist