Skip to content

Commit 66bfc00

Browse files
committed
Remove support for non-1D input to Axes.pie.
1 parent 462eb5f commit 66bfc00

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

doc/api/api_changes_3.3/removals.rst

+2
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ Arguments
219219
``connector`` keyword arguments, which did nothing since 3.0.
220220
- `.TextPath` no longer accepts arbitrary positional or keyword arguments.
221221
- `.MaxNLocator.set_params()` no longer accepts arbitrary keyword arguments.
222+
- `~.Axes.pie` no longer accepts and squeezes non-1D inputs; pass 1D input to
223+
the ``x`` argument.
222224

223225
rcParams
224226
~~~~~~~~

lib/matplotlib/axes/_axes.py

+3-7
Original file line numberDiff line numberDiff line change
@@ -2915,7 +2915,7 @@ def pie(self, x, explode=None, labels=None, colors=None,
29152915
29162916
Parameters
29172917
----------
2918-
x : array-like
2918+
x : 1D array-like
29192919
The wedge sizes.
29202920
29212921
explode : array-like, default: None
@@ -2999,12 +2999,8 @@ def pie(self, x, explode=None, labels=None, colors=None,
29992999
# The use of float32 is "historical", but can't be changed without
30003000
# regenerating the test baselines.
30013001
x = np.asarray(x, np.float32)
3002-
if x.ndim != 1 and x.squeeze().ndim <= 1:
3003-
cbook.warn_deprecated(
3004-
"3.1", message="Non-1D inputs to pie() are currently "
3005-
"squeeze()d, but this behavior is deprecated since %(since)s "
3006-
"and will be removed %(removal)s; pass a 1D array instead.")
3007-
x = np.atleast_1d(x.squeeze())
3002+
if x.ndim > 1:
3003+
raise ValueError("x must be 1D")
30083004

30093005
if np.any(x < 0):
30103006
raise ValueError("Wedge sizes 'x' must be non negative values")

0 commit comments

Comments
 (0)