@@ -628,33 +628,50 @@ class Shadow(Patch):
628628 def __str__ (self ):
629629 return "Shadow(%s)" % (str (self .patch ))
630630
631+ @cbook ._delete_parameter ("3.3" , "props" )
631632 @docstring .dedent_interpd
632633 def __init__ (self , patch , ox , oy , props = None , ** kwargs ):
633634 """
634- Create a shadow of the given *patch* offset by *ox*, *oy* .
635- *props*, if not *None*, is a patch property update dictionary.
636- If *None* , the shadow will have have the same color as the face ,
635+ Create a shadow of the given *patch*.
636+
637+ By default , the shadow will have the same face color as the *patch* ,
637638 but darkened.
638639
639- Valid keyword arguments are:
640+ Parameters
641+ ----------
642+ patch : `.Patch`
643+ The patch to create the shadow for.
644+ ox, oy : float
645+ The shift of the shadow in points.
646+ props : dict
647+ *deprecated (use kwargs instead)* Properties of the shadow patch.
648+ **kwargs
649+ Properties of the shadow patch. Supported keys are:
640650
641- %(Patch)s
651+ %(Patch)s
642652 """
643653 Patch .__init__ (self )
644654 self .patch = patch
645- self .props = props
655+ # Note: when removing props, we can directly pass kwargs to _update()
656+ # and remove self._props
657+ self ._props = {** (props if props is not None else {}), ** kwargs }
646658 self ._ox , self ._oy = ox , oy
647659 self ._shadow_transform = transforms .Affine2D ()
648660 self ._update ()
649661
662+ @cbook .deprecated ("3.3" )
663+ @property
664+ def props (self ):
665+ return self ._props
666+
650667 def _update (self ):
651668 self .update_from (self .patch )
652669
653670 # Place the shadow patch directly behind the inherited patch.
654671 self .set_zorder (np .nextafter (self .patch .zorder , - np .inf ))
655672
656- if self .props is not None :
657- self .update (self .props )
673+ if self ._props :
674+ self .update (self ._props )
658675 else :
659676 color = .3 * np .asarray (colors .to_rgb (self .patch .get_facecolor ()))
660677 self .set_facecolor (color )
0 commit comments