Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Draw RadioButtons using scatter to ensure circular buttons.#24455
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
26580cc
tofcfae34
CompareThere 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.
The fallback is very clever 👍.
To ensure backcompat without bothering the majority of users who don'tactually access the .circles attribute, dynamically (and irreversibly)switch back to the old draw method (list of Circles) whenever thatattribute is accessed for the first time (if ever).
drammock commentedNov 17, 2022 • 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.
What is the recommendation for those of us (MNE-Python) whodo access the If it helps, here is an example of what we do with it: we actually access |
If I've understood what that code does, it appears that you set a radius so that the buttons are reasonably sized. And the second thing is setting specific edge colours for each radio? I think the former is something we should just do, and the latter (styling options) is a reasonable enhancement request if you want to open an issue? |
drammock commentedDec 2, 2022
Another thing we do is apply transforms to ensure buttons are circular. That part should go be able to be removed after this PR, but we'll still want to be able to set size and linewidth (on all buttons uniformly) and set color, edgecolor, and opacity (on each button individually). I've opened#24583 for the feature request. |
Uh oh!
There was an error while loading.Please reload this page.
To ensure backcompat without bothering the majority of users who don't actually access the .circles attribute, dynamically (and irreversibly) switch back to the old draw method (list of Circles) whenever that attribute is accessed for the first time (if ever).
https://matplotlib.org/stable/gallery/widgets/radio_buttons.html now looks like

Note that the buttons are now circular.
Closes#24428.
PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst