@@ -3075,7 +3075,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
30753075 autopct = None , pctdistance = 0.6 , shadow = False , labeldistance = 1.1 ,
30763076 startangle = 0 , radius = 1 , counterclock = True ,
30773077 wedgeprops = None , textprops = None , center = (0 , 0 ),
3078- frame = False , rotatelabels = False , * , normalize = True , hatch = None ):
3078+ frame = False , rotatelabels = False , * , normalize = True , hatch = None ,
3079+ shadow_factor = 0.3 , shadow_offset = (- 0.02 , - 0.02 ), shadow_alpha = 0.5 ):
30793080 """
30803081 Plot a pie chart.
30813082
@@ -3163,6 +3164,16 @@ def pie(self, x, explode=None, labels=None, colors=None,
31633164 ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1``
31643165 and raises a `ValueError` for ``sum(x) > 1``.
31653166
3167+ shadow_factor : float, default: 0.3
3168+ How the darkness of the shadow relates to the original color. If 0, the
3169+ shadow is black, if 1, the shadow has the same color as the *patch*.
3170+
3171+ shadow_offset : (float, float), default: (-0.02, -0.02)
3172+ The (x, y)-offset of the shadow.
3173+
3174+ shadow_alpha : float, default: 0.5
3175+ The alpha value of the shadow.
3176+
31663177 data : indexable object, optional
31673178 DATA_PARAMETER_PLACEHOLDER
31683179
@@ -3255,7 +3266,8 @@ def get_next_color():
32553266 if shadow :
32563267 # Make sure to add a shadow after the call to add_patch so the
32573268 # figure and transform props will be set.
3258- shad = mpatches .Shadow (w , - 0.02 , - 0.02 , label = '_nolegend_' )
3269+ shad = mpatches .Shadow (w , * shadow_offset , shadow_factor = shadow_factor ,
3270+ alpha = shadow_alpha , label = '_nolegend_' )
32593271 self .add_patch (shad )
32603272
32613273 if labeldistance is not None :
0 commit comments