@@ -2728,9 +2728,11 @@ def __init__(self, ax, positions, direction, line_props=None,
2728
2728
_api .check_in_list (['horizontal' , 'vertical' ], direction = direction )
2729
2729
self ._direction = direction
2730
2730
2731
- if line_props is None :
2732
- line_props = {}
2733
- line_props .update ({'visible' : False , 'animated' : useblit })
2731
+ line_props = {
2732
+ ** (line_props if line_props is not None else {}),
2733
+ 'visible' : False ,
2734
+ 'animated' : useblit ,
2735
+ }
2734
2736
2735
2737
line_fun = ax .axvline if self .direction == 'horizontal' else ax .axhline
2736
2738
@@ -3034,9 +3036,8 @@ def __init__(self, ax, onselect, drawtype='box',
3034
3036
if props is None :
3035
3037
props = dict (facecolor = 'red' , edgecolor = 'black' ,
3036
3038
alpha = 0.2 , fill = True )
3037
- props ['animated' ] = self .useblit
3038
- self ._visible = props .pop ('visible' , self ._visible )
3039
- self ._props = props
3039
+ self ._props = {** props , 'animated' : self .useblit }
3040
+ self ._visible = self ._props .pop ('visible' , self ._visible )
3040
3041
to_draw = self ._init_shape (** self ._props )
3041
3042
self .ax .add_patch (to_draw )
3042
3043
if drawtype == 'line' :
@@ -3047,8 +3048,7 @@ def __init__(self, ax, onselect, drawtype='box',
3047
3048
if lineprops is None :
3048
3049
lineprops = dict (color = 'black' , linestyle = '-' ,
3049
3050
linewidth = 2 , alpha = 0.5 )
3050
- lineprops ['animated' ] = self .useblit
3051
- self ._props = lineprops
3051
+ self ._props = {** lineprops , 'animated' : self .useblit }
3052
3052
to_draw = Line2D ([0 , 0 ], [0 , 0 ], visible = False , ** self ._props )
3053
3053
self .ax .add_line (to_draw )
3054
3054
@@ -3621,10 +3621,12 @@ def __init__(self, ax, onselect=None, useblit=True, props=None,
3621
3621
button = None ):
3622
3622
super ().__init__ (ax , onselect , useblit = useblit , button = button )
3623
3623
self .verts = None
3624
- if props is None :
3625
- props = dict ()
3626
- # self.useblit may be != useblit, if the canvas doesn't support blit.
3627
- props .update (animated = self .useblit , visible = False )
3624
+ props = {
3625
+ ** (props if props is not None else {}),
3626
+ # Note that self.useblit may be != useblit, if the canvas doesn't
3627
+ # support blitting.
3628
+ 'animated' : self .useblit , 'visible' : False ,
3629
+ }
3628
3630
line = Line2D ([], [], ** props )
3629
3631
self .ax .add_line (line )
3630
3632
self ._selection_artist = line
@@ -3759,8 +3761,7 @@ def __init__(self, ax, onselect, useblit=False,
3759
3761
3760
3762
if props is None :
3761
3763
props = dict (color = 'k' , linestyle = '-' , linewidth = 2 , alpha = 0.5 )
3762
- props ['animated' ] = self .useblit
3763
- self ._props = props
3764
+ self ._props = {** props , 'animated' : self .useblit }
3764
3765
self ._selection_artist = line = Line2D ([], [], ** self ._props )
3765
3766
self .ax .add_line (line )
3766
3767
0 commit comments