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