Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions lib/matplotlib/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,11 @@ def __init__(self, ax, labels, actives=None, *, useblit=True,

.. versionadded:: 3.7

label_props : dict, optional
Dictionary of `.Text` properties to be used for the labels.
label_props : dict of lists, optional
Dictionary of `.Text` properties to be used for the labels. Each
dictionary value should be a list of at least a single element. If
the list is of length M, its values are cycled such that the Nth
label gets the (N mod M) property.

.. versionadded:: 3.7
frame_props : dict, optional
Expand Down Expand Up @@ -1111,7 +1114,8 @@ def set_label_props(self, props):
Parameters
----------
props : dict
Dictionary of `.Text` properties to be used for the labels.
Dictionary of `.Text` properties to be used for the labels. Same
format as label_props argument of :class:`CheckButtons`.
"""
_api.check_isinstance(dict, props=props)
props = _expand_text_props(props)
Expand Down Expand Up @@ -1579,8 +1583,11 @@ def __init__(self, ax, labels, active=0, activecolor=None, *,

.. versionadded:: 3.7

label_props : dict or list of dict, optional
Dictionary of `.Text` properties to be used for the labels.
label_props : dict of lists, optional
Dictionary of `.Text` properties to be used for the labels. Each
dictionary value should be a list of at least a single element. If
the list is of length M, its values are cycled such that the Nth
label gets the (N mod M) property.

.. versionadded:: 3.7
radio_props : dict, optional
Expand Down Expand Up @@ -1689,7 +1696,8 @@ def set_label_props(self, props):
Parameters
----------
props : dict
Dictionary of `.Text` properties to be used for the labels.
Dictionary of `.Text` properties to be used for the labels. Same
format as label_props argument of :class:`RadioButtons`.
"""
_api.check_isinstance(dict, props=props)
props = _expand_text_props(props)
Expand Down
8 changes: 4 additions & 4 deletions lib/matplotlib/widgets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ class CheckButtons(AxesWidget):
actives: Iterable[bool] | None = ...,
*,
useblit: bool = ...,
label_props: dict[str, Any] | None = ...,
label_props: dict[str, Sequence[Any]] | None = ...,
frame_props: dict[str, Any] | None = ...,
check_props: dict[str, Any] | None = ...,
) -> None: ...
def set_label_props(self, props: dict[str, Any]) -> None: ...
def set_label_props(self, props: dict[str, Sequence[Any]]) -> None: ...
def set_frame_props(self, props: dict[str, Any]) -> None: ...
def set_check_props(self, props: dict[str, Any]) -> None: ...
def set_active(self, index: int, state: bool | None = ...) -> None: ... # type: ignore[override]
Expand Down Expand Up @@ -208,10 +208,10 @@ class RadioButtons(AxesWidget):
activecolor: ColorType | None = ...,
*,
useblit: bool = ...,
label_props: dict[str, Any] | Sequence[dict[str, Any]] | None = ...,
label_props: dict[str, Sequence[Any]] | None = ...,
radio_props: dict[str, Any] | None = ...,
) -> None: ...
def set_label_props(self, props: dict[str, Any]) -> None: ...
def set_label_props(self, props: dict[str, Sequence[Any]]) -> None: ...
def set_radio_props(self, props: dict[str, Any]) -> None: ...
def set_active(self, index: int) -> None: ...
def clear(self) -> None: ...
Expand Down
Loading