@@ -3075,7 +3075,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
3075
3075
autopct = None , pctdistance = 0.6 , shadow = False , labeldistance = 1.1 ,
3076
3076
startangle = 0 , radius = 1 , counterclock = True ,
3077
3077
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 = 1 ):
3079
3080
"""
3080
3081
Plot a pie chart.
3081
3082
@@ -3163,6 +3164,16 @@ def pie(self, x, explode=None, labels=None, colors=None,
3163
3164
``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1``
3164
3165
and raises a `ValueError` for ``sum(x) > 1``.
3165
3166
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
+
3166
3177
data : indexable object, optional
3167
3178
DATA_PARAMETER_PLACEHOLDER
3168
3179
@@ -3255,7 +3266,8 @@ def get_next_color():
3255
3266
if shadow :
3256
3267
# Make sure to add a shadow after the call to add_patch so the
3257
3268
# 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_' )
3259
3271
self .add_patch (shad )
3260
3272
3261
3273
if labeldistance is not None :
0 commit comments