At least 2 of the arguments passed to Figure.__init__ do not have matching get_{kwarg}/set_{kwarg} methods on Figure which makes using fig.set(...) inconsistent with what can be done via Figure(...).
xref #21549 which was motivated by this and includes an implementation of the solution (along with some additional refactoring).
Proposed solution
See #21549 for a majority of the implementation. cherry-picking commits from that branch and dropping the layout management refactoring is a very good start.
use alias mechanism for size_inches -> figsize
add get/set_subplotparams
use alias mechanism from layout -> layout_engine
tests!
whats new entry
Labeling this as good first issue because it is limited scope and easy because there is an existing implementation. There will be a discussion of API consistency so I think familiarity with Matplotlib's explicit API would be very helpful.
And can you specifically mention for which params we have to implement getter and setters
I do not know this off the top of my head, part of the work that needs to be done on this issue is to sort out which of the keywords to __init__ are missing matching setter/getter pairs.
Hi! This is my first contrib and am open to learning any new concepts involved. Could you just elaborate on what you require for the Getters & Setters portion?
Thanks!
It looks like the linked PR (#24696) has been marked as orphaned and needs a rebase. I think taking over that PR is fair game as we have not heard from the original author in a few months.
@shalul The issue is open, so not solved yet. But as linked above, it has an associated open pull request, i.e. a solution proposal. Therefore it does not make sense to work on this issue. Please look for another topic if you want to contribute.
As a side question, we often see people who ask in the way you did above coming from a CS course? Is that true for you as well? If so, which course and did they give you instructions on how to find suitable issues, in particular identifying whether an issue has already an associated open pull request and to judge whether that pull request is still active?
Hey @timhoffm, I see no one answered your question about users coming from CS courses. I am currently taking CEN3031 - Introduction to Software Engineering. It is the first class I've ever taken that has included an assignment relating to open source software contributions. The assignment description asks students to find an open source software, look for an issue labeled "good first issue", and contribute to it. We are told to specifically contribute with code or a bug fix. Nowhere in the assignment description does it mention pull requests, or determining if an issue is still active. The only tips provided relate to choosing a project with an active community with good first issues labeled. After reading this thread, it seems like people may be submitting PR's just for the sake of it (possibly related to assignment requirements for a class), or maybe just not understanding when a solution is in progress. It seems to make more work for the developers approving PRs, so it may help to add a note about this in the various resources for first time contributors. Hope this helps!
@tacaswell Sorry for being late in the process, but we need to clarify the API strategy. Fundamentally,
It's desireable to have naming consistency between kwargs and setters
We should try not to have multiple ways of doing the same thing (shortcut aliases are a permissible exception because they are an intentional tradoff beween clarity and brevity for typing)
We cannot have both without API breakage, so it needs to be a conscious decision for every single case, which depends on boudary conditions like breadth of use and suitability of the name(s). Also we need to consider wether we can/want to move the API through discouraging/(pending) deprecating.
I'm removing the tags "good first issue" and "difficulty: easy" for now. While they are correct for the eventual implementation, we need a though API discussion and decission first. These tags have lead to multiple PRs that just add the new methods but I'm not convinced at all that just adding more API is the right solution. We can add the tags back when we are clear on the API.
Semi-OT: Process-wise we are doing something wrong here. The issue has now 10 PRs trying to address it. This is quite unreasonable and a waste of ressources. I'm not sure what's going wrong, probably it's a combination of factors (i) "Good first issue" attracting contributions, (ii) a too broad / imprecise specification (some issues only address parts), (iii) contributors not delivering to the spec or not responding (iv) our inability to review timely, (v) my general caution on the topic (#24617 (comment)), which led me to ignore the topic for long and hope that somebody else will take the neccessary decisions.
How can we recover and how can we prevent this in the future?
We discussed this issue in the weekly project 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 authors can't open another PR in the future or that the proposed solution is necessarily innapropriate, but this will help us focus our efforts.
Activity
deepgohil commented on Dec 4, 2022
@tacaswell I would like to take this up. As this will be my first contribution to this repo. if you can guide me it will be very helpful.
tacaswell commented on Dec 4, 2022
Please see:
I also strongly suggest you start by cherry-picking the commits from #21549 and use that as a base.
deepgohil commented on Dec 5, 2022
@tacaswell Will you help on following points
Can you elaborate more on alias mechanism of layout and size_inches figsize
And can you specifically mention for which params we have to implement getter and setters
image
tacaswell commented on Dec 5, 2022
See
matplotlib/lib/matplotlib/lines.py
Lines 205 to 216 in aa1c538
I do not know this off the top of my head, part of the work that needs to be done on this issue is to sort out which of the keywords to __init__ are missing matching setter/getter pairs.
Gairick52 commented on Jan 10, 2023
@tacaswell Hello sir,i want to work on this issue,please assign this to me
tacaswell commented on Jan 10, 2023
@Gairick52 as noted in other issues, we do not currently assign issues, if you are interested in working on this please do so and open a PR.
vortex73 commented on Jan 13, 2023
Hi! This is my first contrib and am open to learning any new concepts involved. Could you just elaborate on what you require for the Getters & Setters portion?
Thanks!
NoyHanan commented on May 5, 2023
Hi all, is it still open?
tacaswell commented on May 5, 2023
It looks like the linked PR (#24696) has been marked as orphaned and needs a rebase. I think taking over that PR is fair game as we have not heard from the original author in a few months.
Added setter/getters for Figure for issue matplotlib#24617
8 remaining items
timhoffm commented on Apr 2, 2024
@shalul The issue is open, so not solved yet. But as linked above, it has an associated open pull request, i.e. a solution proposal. Therefore it does not make sense to work on this issue. Please look for another topic if you want to contribute.
As a side question, we often see people who ask in the way you did above coming from a CS course? Is that true for you as well? If so, which course and did they give you instructions on how to find suitable issues, in particular identifying whether an issue has already an associated open pull request and to judge whether that pull request is still active?
priscillajordan commented on Jun 26, 2024
Hey @timhoffm, I see no one answered your question about users coming from CS courses. I am currently taking CEN3031 - Introduction to Software Engineering. It is the first class I've ever taken that has included an assignment relating to open source software contributions. The assignment description asks students to find an open source software, look for an issue labeled "good first issue", and contribute to it. We are told to specifically contribute with code or a bug fix. Nowhere in the assignment description does it mention pull requests, or determining if an issue is still active. The only tips provided relate to choosing a project with an active community with good first issues labeled. After reading this thread, it seems like people may be submitting PR's just for the sake of it (possibly related to assignment requirements for a class), or maybe just not understanding when a solution is in progress. It seems to make more work for the developers approving PRs, so it may help to add a note about this in the various resources for first time contributors. Hope this helps!
issue matplotlib#24617 fixed getter from matplotlib#2509
Thanushri16 commented on Nov 8, 2024
Is the issue 24617 closed?
Fixed matplotlib#24617 and matplotlib#25091-Fixed pre commit issues i…
timhoffm commented on Feb 17, 2025
@tacaswell Sorry for being late in the process, but we need to clarify the API strategy. Fundamentally,
We cannot have both without API breakage, so it needs to be a conscious decision for every single case, which depends on boudary conditions like breadth of use and suitability of the name(s). Also we need to consider wether we can/want to move the API through discouraging/(pending) deprecating.
Let's move the individual discussions to
timhoffm commented on Feb 17, 2025
I'm removing the tags "good first issue" and "difficulty: easy" for now. While they are correct for the eventual implementation, we need a though API discussion and decission first. These tags have lead to multiple PRs that just add the new methods but I'm not convinced at all that just adding more API is the right solution. We can add the tags back when we are clear on the API.
Feature: Added setter/getter methods for missing kwargs in Figure.__i…
timhoffm commented on Feb 17, 2025
Semi-OT: Process-wise we are doing something wrong here. The issue has now 10 PRs trying to address it. This is quite unreasonable and a waste of ressources. I'm not sure what's going wrong, probably it's a combination of factors (i) "Good first issue" attracting contributions, (ii) a too broad / imprecise specification (some issues only address parts), (iii) contributors not delivering to the spec or not responding (iv) our inability to review timely, (v) my general caution on the topic (#24617 (comment)), which led me to ignore the topic for long and hope that somebody else will take the neccessary decisions.
How can we recover and how can we prevent this in the future?
melissawm commented on Mar 27, 2026
We discussed this issue in the weekly project 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 authors can't open another PR in the future or that the proposed solution is necessarily innapropriate, but this will help us focus our efforts.
Thanks!