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

Method _init_props

lib/matplotlib/widgets.py:1867–1896  ·  view source on GitHub ↗
(self, text_size, active, activecolor, radio_props)

Source from the content-addressed store, hash-verified

1865 self.index_selected = active
1866
1867 def _init_props(self, text_size, active, activecolor, radio_props):
1868 radio_props = {
1869 's': text_size**2,
1870 **radio_props,
1871 'marker': 'o',
1872 'transform': self.ax.transAxes,
1873 'animated': self._useblit and self.canvas.supports_blit,
1874 # TODO: This may need an update when switching out the canvas.
1875 # Can set this to `_useblit` only and live with the animated=True
1876 # overhead on unsupported backends.
1877
1878 }
1879 radio_props.setdefault('edgecolor', radio_props.get('color', 'black'))
1880 radio_props.setdefault('facecolor',
1881 radio_props.pop('color', activecolor))
1882 self._buttons = self.ax.scatter(
1883 self._buttons_xs,
1884 self._buttons_ys,
1885 **radio_props,
1886 )
1887 # The user may have passed custom colours in radio_props, so we need to
1888 # create the radios, and modify the visibility after getting whatever
1889 # the user set.
1890 self._active_colors = self._buttons.get_facecolor()
1891 if len(self._active_colors) == 1:
1892 self._active_colors = np.repeat(self._active_colors, len(self.labels),
1893 axis=0)
1894 self._buttons.set_facecolor(
1895 [activecolor if i == active else "none"
1896 for i, activecolor in enumerate(self._active_colors)])
1897
1898 def set_radio_props(self, props):
1899 """

Callers

nothing calls this directly

Calls 5

getMethod · 0.45
popMethod · 0.45
scatterMethod · 0.45
get_facecolorMethod · 0.45
set_facecolorMethod · 0.45

Tested by

no test coverage detected