@@ -628,33 +628,51 @@ 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 data coordinates, scaled by a factor
646+ of dpi/72.
647+ props : dict
648+ *deprecated (use kwargs instead)* Properties of the shadow patch.
649+ **kwargs
650+ Properties of the shadow patch. Supported keys are:
640651
641- %(Patch)s
652+ %(Patch)s
642653 """
643654 Patch .__init__ (self )
644655 self .patch = patch
645- self .props = props
656+ # Note: when removing props, we can directly pass kwargs to _update()
657+ # and remove self._props
658+ self ._props = {** (props if props is not None else {}), ** kwargs }
646659 self ._ox , self ._oy = ox , oy
647660 self ._shadow_transform = transforms .Affine2D ()
648661 self ._update ()
649662
663+ @cbook .deprecated ("3.3" )
664+ @property
665+ def props (self ):
666+ return self ._props
667+
650668 def _update (self ):
651669 self .update_from (self .patch )
652670
653671 # Place the shadow patch directly behind the inherited patch.
654672 self .set_zorder (np .nextafter (self .patch .zorder , - np .inf ))
655673
656- if self .props is not None :
657- self .update (self .props )
674+ if self ._props :
675+ self .update (self ._props )
658676 else :
659677 color = .3 * np .asarray (colors .to_rgb (self .patch .get_facecolor ()))
660678 self .set_facecolor (color )
0 commit comments