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

Add styling support to Check and Radio buttons#24838

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

Merged
ksunden merged 4 commits intomatplotlib:mainfromQuLogic:button-props
Jan 23, 2023

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedDec 29, 2022
edited
Loading

PR Summary

This implements arguments to override the styling ofCheckButtons andRadioButtons, in a manner similar to the existingToolHandles orSelectors. This depends on#23457 to avoid the conflicts on the arguments. I updated the examples to show what this looks like, but not the tests or documentation yet. I have two questions:

  1. Are the argument names reasonable?
  2. What to do about the label properties? The other items are put inscatter, whichdoes have aCollection, so they acceptdict with elements that are singular or lists. However, we don't have aTextCollection, so I had to make it take adict orlist of dict. This seems inconsistent, so perhaps I should attempt to implement the former input here?

Fixes#24583

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (andpytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a.. versionadded:: directive in the docstring and documented indoc/users/next_whats_new/
  • API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

actives=[l.get_visible() for l in lines_by_label.values()],
label_props=[{'color': 'k'}, {'color': 'r'}, {'color': 'g'}],
frame_props={'edgecolor': ['k', 'r', 'g']},
check_props={'facecolor': ['k', 'r', 'g']},

Choose a reason for hiding this comment

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

I looked atthe rendered doc and noticed that the Xs are still black, I think maybeedgecolor is what was intended here?

Suggested change
check_props={'facecolor': ['k','r','g']},
check_props={'edgecolor': ['k','r','g']},

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

No, the bug is inwidgets.py; I just need to work out what exactly the semantics for color/facecolor/edgecolor will be.

drammock reacted with thumbs up emoji
@ksunden
Copy link
Member

@QuLogic I think you had indicated in alternate communication channels that this was ready for review, but it is still marked as draft.

@QuLogic
Copy link
MemberAuthor

@ksunden Ah, sorry, I thought I pushed the button here; maybe an outdated browser page or something.

@QuLogicQuLogic marked this pull request as ready for reviewJanuary 17, 2023 01:07
@ksunden
Copy link
Member

Probably should have awhatsnew entry to highlight the api changes

@QuLogic
Copy link
MemberAuthor

Added the what's new and handling ofactivecolor as mentioned in call yesterday.

Copy link
Member

@dstansbydstansby left a comment

Choose a reason for hiding this comment

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

Lots of suggestions and minor comments. The major change request I have is to double check this is working - I think it's worth adding a test that doesn't compare new API to new API, and looking at the what's new entry some of the styling for check buttons doesn't seem to be applied.

@QuLogic
Copy link
MemberAuthor

I modified a test image to include old and new versions, and I think should've handling your other comments in a previous push.

@ksundenksunden merged commitbf2d1dc intomatplotlib:mainJan 23, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestJan 23, 2023
ksunden added a commit that referenced this pull requestJan 23, 2023
…838-on-v3.7.xBackport PR#24838 on branch v3.7.x (Add styling support to Check and Radio buttons )
@QuLogicQuLogic deleted the button-props branchJanuary 23, 2023 23:09
@ksundenksunden mentioned this pull requestFeb 20, 2023
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@tacaswelltacaswelltacaswell left review comments

@drammockdrammockdrammock left review comments

@ksundenksundenksunden left review comments

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.7.0
Development

Successfully merging this pull request may close these issues.

[ENH]: provide public API for styling radio buttons
5 participants
@QuLogic@ksunden@tacaswell@drammock@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp