Skip to content

Commit e07e3a4

Browse files
committed
Deprecate additional positional args to plot_{surface,wireframe}.
Previously, a 4th positional parameter to plot_surface would be nonsensically interpreted as the `sizes` property of the PolyCollection, and a 4th positional parameter would be interpreted as the `linewidths` of the LineCollection, which is more useful but not so obvious. Instead, deprecate these uses (one can still set these using keyword arguments), in preparation of overloading these functions as `plot_{surface,wireframe}([X, Y], Z)` instead (i.e., defaulting X and Y to the correct meshgrid, similarly to what we already do e.g. for the 2D `pcolor`-style functions).
1 parent 99e6240 commit e07e3a4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Extra positional parameters to ``plot_surface`` and ``plot_wireframe``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Positional parameters to `~.axes3d.Axes3D.plot_surface` and
4+
`~.axes3d.Axes3D.plot_wireframe` other than ``X``, ``Y``, and ``Z`` are
5+
deprecated. Pass additional artist properties as keyword arguments instead.

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,7 @@ def plot(self, xs, ys, *args, zdir='z', **kwargs):
14931493

14941494
plot3D = plot
14951495

1496+
@_api.delete_parameter("3.4", "args", alternative="kwargs")
14961497
def plot_surface(self, X, Y, Z, *args, norm=None, vmin=None,
14971498
vmax=None, lightsource=None, **kwargs):
14981499
"""
@@ -1764,6 +1765,7 @@ def norm(x):
17641765

17651766
return colors
17661767

1768+
@_api.delete_parameter("3.4", "args", alternative="kwargs")
17671769
def plot_wireframe(self, X, Y, Z, *args, **kwargs):
17681770
"""
17691771
Plot a 3D wireframe.

0 commit comments

Comments
 (0)