| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| Custom styling of button widgets | ||
| -------------------------------- | ||
|
|
||
| Additional custom styling of button widgets may be achieved via the | ||
| *label_props* and *radio_props* arguments to `.RadioButtons`; and the | ||
| *label_props*, *frame_props*, and *check_props* arguments to `.CheckButtons`. | ||
|
|
||
| .. plot:: | ||
|
|
||
| from matplotlib.widgets import CheckButtons, RadioButtons | ||
|
|
||
| fig, ax = plt.subplots(nrows=2, ncols=2, figsize=(5, 2), width_ratios=[1, 2]) | ||
| default_rb = RadioButtons(ax[0, 0], ['Apples', 'Oranges']) | ||
| styled_rb = RadioButtons(ax[0, 1], ['Apples', 'Oranges'], | ||
| label_props={'color': ['red', 'orange'], | ||
| 'fontsize': [16, 20]}, | ||
| radio_props={'edgecolor': ['red', 'orange'], | ||
| 'facecolor': ['mistyrose', 'peachpuff']}) | ||
|
|
||
| default_cb = CheckButtons(ax[1, 0], ['Apples', 'Oranges'], | ||
| actives=[True, True]) | ||
| styled_cb = CheckButtons(ax[1, 1], ['Apples', 'Oranges'], | ||
| actives=[True, True], | ||
| label_props={'color': ['red', 'orange'], | ||
| 'fontsize': [16, 20]}, | ||
| frame_props={'edgecolor': ['red', 'orange'], | ||
| 'facecolor': ['mistyrose', 'peachpuff']}, | ||
| check_props={'color': ['darkred', 'darkorange']}) | ||
|
|
||
| ax[0, 0].set_title('Default') | ||
| ax[0, 1].set_title('Stylized') | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.