@@ -2980,7 +2980,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
2980
2980
autopct = None , pctdistance = 0.6 , shadow = False , labeldistance = 1.1 ,
2981
2981
startangle = 0 , radius = 1 , counterclock = True ,
2982
2982
wedgeprops = None , textprops = None , center = (0 , 0 ),
2983
- frame = False , rotatelabels = False , * , normalize = None ):
2983
+ frame = False , rotatelabels = False , * , normalize = True ):
2984
2984
"""
2985
2985
Plot a pie chart.
2986
2986
@@ -3021,19 +3021,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
3021
3021
shadow : bool, default: False
3022
3022
Draw a shadow beneath the pie.
3023
3023
3024
- normalize : None or bool, default: None
3024
+ normalize : bool, default: True
3025
3025
When *True*, always make a full pie by normalizing x so that
3026
3026
``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1``
3027
3027
and raises a `ValueError` for ``sum(x) > 1``.
3028
3028
3029
- When *None*, defaults to *True* if ``sum(x) >= 1`` and *False* if
3030
- ``sum(x) < 1``.
3031
-
3032
- Please note that the previous default value of *None* is now
3033
- deprecated, and the default will change to *True* in the next
3034
- release. Please pass ``normalize=False`` explicitly if you want to
3035
- draw a partial pie.
3036
-
3037
3029
labeldistance : float or None, default: 1.1
3038
3030
The radial distance at which the pie labels are drawn.
3039
3031
If set to ``None``, label are not drawn, but are stored for use in
@@ -3102,17 +3094,6 @@ def pie(self, x, explode=None, labels=None, colors=None,
3102
3094
3103
3095
sx = x .sum ()
3104
3096
3105
- if normalize is None :
3106
- if sx < 1 :
3107
- _api .warn_deprecated (
3108
- "3.3" , message = "normalize=None does not normalize "
3109
- "if the sum is less than 1 but this behavior "
3110
- "is deprecated since %(since)s until %(removal)s. "
3111
- "After the deprecation "
3112
- "period the default value will be normalize=True. "
3113
- "To prevent normalization pass normalize=False " )
3114
- else :
3115
- normalize = True
3116
3097
if normalize :
3117
3098
x = x / sx
3118
3099
elif sx > 1 :
@@ -3133,20 +3114,11 @@ def pie(self, x, explode=None, labels=None, colors=None,
3133
3114
def get_next_color ():
3134
3115
return next (color_cycle )
3135
3116
3136
- if radius is None :
3137
- _api .warn_deprecated (
3138
- "3.3" , message = "Support for passing a radius of None to mean "
3139
- "1 is deprecated since %(since)s and will be removed "
3140
- "%(removal)s." )
3141
- radius = 1
3117
+ _api .check_isinstance (Number , radius = radius , startangle = startangle )
3118
+ if radius <= 0 :
3119
+ raise ValueError (f'radius must be a positive number, not { radius } ' )
3142
3120
3143
3121
# Starting theta1 is the start fraction of the circle
3144
- if startangle is None :
3145
- _api .warn_deprecated (
3146
- "3.3" , message = "Support for passing a startangle of None to "
3147
- "mean 0 is deprecated since %(since)s and will be removed "
3148
- "%(removal)s." )
3149
- startangle = 0
3150
3122
theta1 = startangle / 360
3151
3123
3152
3124
if wedgeprops is None :
0 commit comments