MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_radio_props

Method set_radio_props

lib/matplotlib/widgets.py:1898–1920  ·  view source on GitHub ↗

Set properties of the `.Text` labels. .. versionadded:: 3.7 Parameters ---------- props : dict Dictionary of `.Collection` properties to be used for the radio buttons.

(self, props)

Source from the content-addressed store, hash-verified

1896 for i, activecolor in enumerate(self._active_colors)])
1897
1898 def set_radio_props(self, props):
1899 """
1900 Set properties of the `.Text` labels.
1901
1902 .. versionadded:: 3.7
1903
1904 Parameters
1905 ----------
1906 props : dict
1907 Dictionary of `.Collection` properties to be used for the radio
1908 buttons.
1909 """
1910 _api.check_isinstance(dict, props=props)
1911 if 's' in props: # Keep API consistent with constructor.
1912 props['sizes'] = np.broadcast_to(props.pop('s'), len(self.labels))
1913 self._buttons.update(props)
1914 self._active_colors = self._buttons.get_facecolor()
1915 if len(self._active_colors) == 1:
1916 self._active_colors = np.repeat(self._active_colors,
1917 len(self.labels), axis=0)
1918 self._buttons.set_facecolor(
1919 [activecolor if text.get_text() == self.value_selected else "none"
1920 for text, activecolor in zip(self.labels, self._active_colors)])
1921
1922 @property
1923 def activecolor(self):

Callers 2

activecolorMethod · 0.95
test_radio_buttons_propsFunction · 0.95

Calls 5

popMethod · 0.45
updateMethod · 0.45
get_facecolorMethod · 0.45
set_facecolorMethod · 0.45
get_textMethod · 0.45

Tested by 1

test_radio_buttons_propsFunction · 0.76