Skip to content

Commit 95c4dda

Browse files
committed
{Check,Radio}Buttons: Improve docs of label_props
1 parent 2b0f3dc commit 95c4dda

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

lib/matplotlib/widgets.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,11 @@ def __init__(self, ax, labels, actives=None, *, useblit=True,
10161016
10171017
.. versionadded:: 3.7
10181018
1019-
label_props : dict, optional
1020-
Dictionary of `.Text` properties to be used for the labels.
1019+
label_props : dict of lists, or list of dict, optional
1020+
Dictionary of `.Text` properties to be used for the labels. Each
1021+
dictionary value should be a list of at least a single element. If
1022+
the list is of length M, its values are cycled such that the Nth
1023+
label gets the (N mod M) property.
10211024
10221025
.. versionadded:: 3.7
10231026
frame_props : dict, optional
@@ -1117,7 +1120,8 @@ def set_label_props(self, props):
11171120
Parameters
11181121
----------
11191122
props : dict
1120-
Dictionary of `.Text` properties to be used for the labels.
1123+
Dictionary of `.Text` properties to be used for the labels. Same
1124+
format as label_props argument of `__init__`.
11211125
"""
11221126
_api.check_isinstance(dict, props=props)
11231127
props = _expand_text_props(props)
@@ -1585,8 +1589,11 @@ def __init__(self, ax, labels, active=0, activecolor=None, *,
15851589
15861590
.. versionadded:: 3.7
15871591
1588-
label_props : dict or list of dict, optional
1589-
Dictionary of `.Text` properties to be used for the labels.
1592+
label_props : dict of lists, or list of dict, optional
1593+
Dictionary of `.Text` properties to be used for the labels. Each
1594+
dictionary value should be a list of at least a single element. If
1595+
the list is of length M, its values are cycled such that the Nth
1596+
label gets the (N mod M) property.
15901597
15911598
.. versionadded:: 3.7
15921599
radio_props : dict, optional
@@ -1695,7 +1702,8 @@ def set_label_props(self, props):
16951702
Parameters
16961703
----------
16971704
props : dict
1698-
Dictionary of `.Text` properties to be used for the labels.
1705+
Dictionary of `.Text` properties to be used for the labels. Same
1706+
format as label_props argument of `__init__`.
16991707
"""
17001708
_api.check_isinstance(dict, props=props)
17011709
props = _expand_text_props(props)

0 commit comments

Comments
 (0)