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

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

Draft
the-msmathew wants to merge5 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromthe-msmathew:add_fontfamily_ticks

Conversation

the-msmathew
Copy link

@the-msmathewthe-msmathew commentedDec 14, 2020
edited
Loading

…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

  • [- ] Has pytest style unit tests (andpytest passes).
  • [- ] IsFlake 8 compliant (runflake8 on changed files to check).
  • [ -] New features are documented, with examples if plot related.
  • [ -] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • [ -] Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • [ -] 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).

petermckeeverPerform reacted with heart emoji
@jklymak
Copy link
Member

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
Copy link
Author

the-msmathew commentedDec 14, 2020
edited
Loading

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.

@jklymak
Copy link
Member

There are about 12,000 examples to choose from ;-)

Copy link
Member

@timhoffmtimhoffm left a 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.

jklymak, the-msmathew, and story645 reacted with thumbs up emoji
@the-msmathew
Copy link
Author

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.

timhoffm reacted with thumbs up emoji

@dopplershiftdopplershift linked an issueDec 15, 2020 that may beclosed by this pull request
@jklymakjklymak marked this pull request as draftMay 11, 2021 00:05
@github-actions
Copy link

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.

@github-actionsgithub-actionsbot added the status: inactiveMarked by the “Stale” Github Action labelSep 20, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm left review comments

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

Assignees
No one assigned
Labels
status: inactiveMarked by the “Stale” Github Actionstatus: needs rebasestatus: needs revision
Projects
Status: Waiting for author
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add fontfamily/labelfont to tick_params
4 participants
@the-msmathew@jklymak@timhoffm@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp