Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04d8fda

Browse files
committed
Update radio buttons to also use correct setter
1 parent 61db294 commit 04d8fda

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/widgets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,8 +1488,10 @@ def set_active(self, index):
14881488
if index not in range(len(self.labels)):
14891489
raise ValueError(f'Invalid RadioButton index: {index}')
14901490
self.value_selected = self.labels[index].get_text()
1491-
self._buttons.get_facecolor()[:] = colors.to_rgba("none")
1492-
self._buttons.get_facecolor()[index] = colors.to_rgba(self.activecolor)
1491+
button_facecolors = self._buttons.get_facecolor()
1492+
button_facecolors[:] = colors.to_rgba("none")
1493+
button_facecolors[index] = colors.to_rgba(self.activecolor)
1494+
self._buttons.set_facecolor(button_facecolors)
14931495
if hasattr(self, "_circles"): # Remove once circles is removed.
14941496
for i, p in enumerate(self._circles):
14951497
p.set_facecolor(self.activecolor if i == index else "none")

0 commit comments

Comments
 (0)