Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
edited 2D Object to add labelfont alias so that tick_params can direc…#19110
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…tly have kward to set label fonts
…ont at instantiation
Thanks for this. Seems reasonable on a first look. Can you curate the PR description a bit? Also why is _invalidy being set in the setter? |
the-msmathew commentedDec 14, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The 'invalidy = True' was a misstep based on the previous fcn definition. I can remove that. By 'curate the PR description', does that mean give more detail on the 'PR Summary' above? If so, I added more detail, but if there's different types of details I should add, I can go ahead and do so. |
… pasted line from diff func when creating fcn definition
…states of other variables
There are about 12,000 examples to choose from ;-) |
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.
Welcome to Matplotlib, and thanks for the contribution! IMHO the PR description is fine now.
What I don't understand: Why do you have to add afont
property toLines2D
. That seems quite odd as lines conceptually do not have a font.
Looking a bit into it, you need to add an explcit parameterlabelfont
to the classTick
instead ofLine2D
, and use that to modify the createdText
(self.label1 = mtext.Text(...)
,self.label2 = mtext.Text(...)
) - analogous tolabelsize
andlabelcolor
.
Intuitively, that makes sense. When I originally added a nonexistent kwarg to tick_params to see where the function calls would take me, it seemed like the error eventually occurred where I edited the files as part of the Line2D Object. Thank you for the feedback and I can make edits in the Tick class instead if that's better for maintainability. |
Since this Pull Request has not been updated in 60 days, it has been marked "inactive." This does not mean that it will be closed, though it may be moved to a "Draft" state. This helps maintainers prioritize their reviewing efforts. You can pick the PR back up anytime - please ping us if you need a review or guidance to move the PR forward! If you do not plan on continuing the work, please let us know so that we can either find someone to take the PR over, or close it. |
Uh oh!
There was an error while loading.Please reload this page.
…tly have kward to set label fonts
PR Summary
Based on new feature request from,#18425
In order to complete these, I added another kwarg keyword, 'labelfont' in the Line2D object in matplotlib/lines.py and added relevant getter/setter functions. A keyword was also added in axis.py where parameters are actually applied.
This will allow a user to call tick_params and set the font family separate from the rest of the text on the figure without having to also invoke set_ylabels using axes.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).