@@ -624,33 +624,51 @@ class Shadow(Patch):
624624 def __str__ (self ):
625625 return "Shadow(%s)" % (str (self .patch ))
626626
627+ @cbook ._delete_parameter ("3.3" , "props" )
627628 @docstring .dedent_interpd
628629 def __init__ (self , patch , ox , oy , props = None , ** kwargs ):
629630 """
630- Create a shadow of the given *patch* offset by *ox*, *oy* .
631- *props*, if not *None*, is a patch property update dictionary.
632- If *None* , the shadow will have have the same color as the face ,
631+ Create a shadow of the given *patch*.
632+
633+ By default , the shadow will have the same face color as the *patch* ,
633634 but darkened.
634635
635- Valid keyword arguments are:
636+ Parameters
637+ ----------
638+ patch : `.Patch`
639+ The patch to create the shadow for.
640+ ox, oy : float
641+ The shift of the shadow in data coordinates, scaled by a factor
642+ of dpi/72.
643+ props : dict
644+ *deprecated (use kwargs instead)* Properties of the shadow patch.
645+ **kwargs
646+ Properties of the shadow patch. Supported keys are:
636647
637- %(Patch)s
648+ %(Patch)s
638649 """
639650 Patch .__init__ (self )
640651 self .patch = patch
641- self .props = props
652+ # Note: when removing props, we can directly pass kwargs to _update()
653+ # and remove self._props
654+ self ._props = {** (props if props is not None else {}), ** kwargs }
642655 self ._ox , self ._oy = ox , oy
643656 self ._shadow_transform = transforms .Affine2D ()
644657 self ._update ()
645658
659+ @cbook .deprecated ("3.3" )
660+ @property
661+ def props (self ):
662+ return self ._props
663+
646664 def _update (self ):
647665 self .update_from (self .patch )
648666
649667 # Place the shadow patch directly behind the inherited patch.
650668 self .set_zorder (np .nextafter (self .patch .zorder , - np .inf ))
651669
652- if self .props is not None :
653- self .update (self .props )
670+ if self ._props :
671+ self .update (self ._props )
654672 else :
655673 color = .3 * np .asarray (colors .to_rgb (self .patch .get_facecolor ()))
656674 self .set_facecolor (color )
0 commit comments