@@ -627,33 +627,51 @@ class Shadow(Patch):
627627 def __str__ (self ):
628628 return "Shadow(%s)" % (str (self .patch ))
629629
630+ @cbook ._delete_parameter ("3.3" , "props" )
630631 @docstring .dedent_interpd
631632 def __init__ (self , patch , ox , oy , props = None , ** kwargs ):
632633 """
633- Create a shadow of the given *patch* offset by *ox*, *oy* .
634- *props*, if not *None*, is a patch property update dictionary.
635- If *None* , the shadow will have have the same color as the face ,
634+ Create a shadow of the given *patch*.
635+
636+ By default , the shadow will have the same face color as the *patch* ,
636637 but darkened.
637638
638- Valid keyword arguments are:
639+ Parameters
640+ ----------
641+ patch : `.Patch`
642+ The patch to create the shadow for.
643+ ox, oy : float
644+ The shift of the shadow in data coordinates, scaled by a factor
645+ of dpi/72.
646+ props : dict
647+ *deprecated (use kwargs instead)* Properties of the shadow patch.
648+ **kwargs
649+ Properties of the shadow patch. Supported keys are:
639650
640- %(Patch)s
651+ %(Patch)s
641652 """
642653 Patch .__init__ (self )
643654 self .patch = patch
644- 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 }
645658 self ._ox , self ._oy = ox , oy
646659 self ._shadow_transform = transforms .Affine2D ()
647660 self ._update ()
648661
662+ @cbook .deprecated ("3.3" )
663+ @property
664+ def props (self ):
665+ return self ._props
666+
649667 def _update (self ):
650668 self .update_from (self .patch )
651669
652670 # Place the shadow patch directly behind the inherited patch.
653671 self .set_zorder (np .nextafter (self .patch .zorder , - np .inf ))
654672
655- if self .props is not None :
656- self .update (self .props )
673+ if self ._props :
674+ self .update (self ._props )
657675 else :
658676 color = .3 * np .asarray (colors .to_rgb (self .patch .get_facecolor ()))
659677 self .set_facecolor (color )
0 commit comments