@@ -1585,7 +1585,7 @@ class RadioButtons(AxesWidget):
15851585 The label text of the currently selected button.
15861586 """
15871587
1588- def __init__ (self , ax , labels , active = 0 , activecolor = 'blue' , * ,
1588+ def __init__ (self , ax , labels , active = 0 , activecolor = None , * ,
15891589 useblit = True , label_props = None , radio_props = None ):
15901590 """
15911591 Add radio buttons to an `~.axes.Axes`.
@@ -1599,12 +1599,8 @@ def __init__(self, ax, labels, active=0, activecolor='blue', *,
15991599 active : int
16001600 The index of the initially selected button.
16011601 activecolor : color
1602- The color of the selected button.
1603-
1604- .. note::
1605- If a facecolor is supplied in *radio_props*, it will override
1606- *activecolor*. This may be used to provide an active color per
1607- button.
1602+ The color of the selected button. The default is ``'blue'`` if not
1603+ specified here or in *radio_props*.
16081604 useblit : bool, default: True
16091605 Use blitting for faster drawing if supported by the backend.
16101606 See the tutorial :doc:`/tutorials/advanced/blitting` for details.
@@ -1621,6 +1617,21 @@ def __init__(self, ax, labels, active=0, activecolor='blue', *,
16211617 button.
16221618 """
16231619 super ().__init__ (ax )
1620+
1621+ _api .check_isinstance ((dict , None ), label_props = label_props ,
1622+ radio_props = radio_props )
1623+
1624+ radio_props = cbook .normalize_kwargs (radio_props ,
1625+ collections .PathCollection )
1626+ if activecolor is not None :
1627+ if 'facecolor' in radio_props :
1628+ _api .warn_external (
1629+ 'Both the *activecolor* parameter and the *facecolor* '
1630+ 'key in the *radio_props* parameter has been specified. '
1631+ '*activecolor* will be ignored.' )
1632+ else :
1633+ activecolor = 'blue' # Default.
1634+
16241635 self .activecolor = activecolor
16251636 self .value_selected = labels [active ]
16261637
@@ -1633,9 +1644,6 @@ def __init__(self, ax, labels, active=0, activecolor='blue', *,
16331644 self ._useblit = useblit and self .canvas .supports_blit
16341645 self ._background = None
16351646
1636- _api .check_isinstance ((dict , None ), label_props = label_props ,
1637- radio_props = radio_props )
1638-
16391647 label_props = _expand_text_props (label_props )
16401648 self .labels = [
16411649 ax .text (0.25 , y , label , transform = ax .transAxes ,
@@ -1646,7 +1654,7 @@ def __init__(self, ax, labels, active=0, activecolor='blue', *,
16461654
16471655 radio_props = {
16481656 's' : text_size ** 2 ,
1649- ** cbook . normalize_kwargs ( radio_props , collections . PathCollection ) ,
1657+ ** radio_props ,
16501658 'marker' : 'o' ,
16511659 'transform' : ax .transAxes ,
16521660 'animated' : self ._useblit ,
0 commit comments