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

Corrected the slider handle styling#27674

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

Open
shcrela wants to merge2 commits intomatplotlib:main
base:main
Choose a base branch
Loading
fromshcrela:slider-handle-styling

Conversation

shcrela
Copy link

PR summary

resolves#27672

The slider handle marker style can now be provided in handle_style dict with"marker: "^".
It still defaults to"o".

PR checklist

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

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 uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

handle_style = {} if handle_style is None else handle_style
marker_props = {
f'marker{k}': v for k, v in {**defaults, **handle_style}.items()
f'{"marker" * (not k.startswith("marker")) + k}': v \
Copy link
Member

Choose a reason for hiding this comment

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

Your suggestion would broaden the API so that we'd accepthandle_style={'markerfacecolor': ...}. It would be a separate debate whether that is reasonable, and it would also create some ambiguityhandle_style={'markerfacecolor': 'r', 'facecolor': 'g'}. So for now, I suggest to only expand to accept "marker":

Suggested change
f'{"marker"* (notk.startswith("marker"))+k}':v \
f'{"marker"* (k!=marker)+k}':v

Also this arithmethic is quite clever and we might want to be more explcit

            def prefix_marker(key):                return key if key == "marker" else "marker" + key                            makrer_props = {                prefix_marker(k): v for ...

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for your comments, they are very insightful and so to the point. I absolutely agree with everything you said :)
Would you mind pointing out to where this 'prefix_marker' function should be defined?

Copy link
Member

Choose a reason for hiding this comment

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

It can be a nested function unless we have some other place to use it, and it'd be more for self-documentation.

Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@timhoffmtimhoffmtimhoffm left review comments

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

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

Assignees
No one assigned
Projects
Status: Needs review
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Bug]: Customizing Slider appereance
3 participants
@shcrela@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp