Skip to content

Commit fe4fcac

Browse files
committed
Remove deprecated parameters.
1 parent bd9f225 commit fe4fcac

File tree

10 files changed

+55
-53
lines changed

10 files changed

+55
-53
lines changed

doc/api/next_api_changes/removals/18747-ES.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
instead
77
- ``axes.SubplotBase.colNum``; use ``ax.get_subplotspec().colspan.start``
88
instead
9+
- the *verts* parameter to ``scatter`` (use *marker* instead)
10+
- Passing more than one positional argument to `~matplotlib.axes.Axes.axis`
11+
will now raise an error.
12+
- Passing ``"range"`` to the *whis* parameter of `.Axes.boxplot` and
13+
`.cbook.boxplot_stats` to mean "the whole data range" is no longer
14+
supported.
15+
- Passing scalars to parameter *where* in `.axes.Axes.fill_between` and
16+
`.axes.Axes.fill_betweenx` is no longer accepted and non-matching sizes now
17+
raise a `ValueError`.
918

1019
``dates`` functions
1120
~~~~~~~~~~~~~~~~~~~
@@ -25,3 +34,19 @@ deleted, and the following methods are removed:
2534

2635
- ``Axis.set_smart_bounds`` and ``Axis.get_smart_bounds``
2736
- ``Spine.set_smart_bounds`` and ``Spine.get_smart_bounds``
37+
38+
Testing
39+
~~~~~~~
40+
The *switch_backend_warn* parameter to ``matplotlib.test`` has no effect and
41+
has been removed.
42+
43+
``tight_layout()``
44+
~~~~~~~~~~~~~~~~~~
45+
The *renderer* parameter to `.Figure.tight_layout` has been removed; this
46+
method now always uses the renderer instance cached on the `.Figure`.
47+
48+
``axes_grid1``
49+
~~~~~~~~~~~~~~
50+
- The *locator* parameter to ``colorbar()`` has been removed in favor of its
51+
synonym *ticks* (which already existed previously, and is consistent with
52+
:mod:`matplotlib.colorbar`).

doc/api/prev_api_changes/api_changes_3.2.0/deprecations.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ Passing scalars to parameter *where* in ``fill_between()`` and
142142
broadcasted to the size of *x*. Non-matching sizes will raise a ``ValueError``
143143
in the future.
144144

145+
``scatter()``
146+
~~~~~~~~~~~~~
147+
Passing the *verts* parameter to `.axes.Axes.scatter` is deprecated; use the
148+
*marker* parameter instead.
149+
145150
``tight_layout()``
146151
~~~~~~~~~~~~~~~~~~
147152
The ``renderer`` parameter to `.Figure.tight_layout` is deprecated; this method
@@ -255,8 +260,8 @@ both 1) matplotlib's conftests have not been called and 2) nose is in
255260
During the deprecation period, to force the generation of nose base tests,
256261
import nose first.
257262

258-
The ``switch_backend_warn`` parameter to ``matplotlib.test`` has no effect and
259-
is deprecated.
263+
The *switch_backend_warn* parameter to ``matplotlib.test`` has no effect and is
264+
deprecated.
260265

261266
``testing.jpl_units.UnitDbl.UnitDbl.checkUnits`` is deprecated.
262267

doc/api/prev_api_changes/api_changes_3.2.0/removals.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ The following API elements have been removed:
5757
instead)
5858
- ``axisartist.axes_divider.Axes``, ``axisartist.axes_divider.LocatableAxes``
5959
(use ``axisartist.axislines.Axes`` instead)
60-
- the ``normed`` kwarg to ``hist`` (use ``density`` instead)
61-
- the ``verts`` parameter to ``scatter`` (use ``marker`` instead)
60+
- the *normed* keyword argument to ``hist`` (use *density* instead)
6261
- passing ``(verts, 0)`` or ``(..., 3)`` when specifying a marker to specify a
6362
path or a circle, respectively (instead, use ``verts`` or ``"o"``,
6463
respectively)

lib/matplotlib/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,10 +1188,8 @@ def _init_tests():
11881188
"" if ft2font.__freetype_build_type__ == 'local' else "not "))
11891189

11901190

1191-
@cbook._delete_parameter("3.2", "switch_backend_warn")
11921191
@cbook._delete_parameter("3.3", "recursionlimit")
1193-
def test(verbosity=None, coverage=False, switch_backend_warn=True,
1194-
recursionlimit=0, **kwargs):
1192+
def test(verbosity=None, coverage=False, *, recursionlimit=0, **kwargs):
11951193
"""Run the matplotlib test suite."""
11961194

11971195
try:

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,7 +3476,6 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
34763476
If a pair of floats, they indicate the percentiles at which to
34773477
draw the whiskers (e.g., (5, 95)). In particular, setting this to
34783478
(0, 100) results in whiskers covering the whole range of the data.
3479-
"range" is a deprecated synonym for (0, 100).
34803479
34813480
In the edge case where ``Q1 == Q3``, *whis* is automatically set
34823481
to (0, 100) (cover the whole range of the data) if *autorange* is
@@ -4231,11 +4230,9 @@ def invalid_shape_exception(csize, xsize):
42314230
"edgecolors", "c", "facecolor",
42324231
"facecolors", "color"],
42334232
label_namer="y")
4234-
@cbook._delete_parameter("3.2", "verts")
42354233
def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
4236-
vmin=None, vmax=None, alpha=None, linewidths=None,
4237-
verts=None, edgecolors=None, *, plotnonfinite=False,
4238-
**kwargs):
4234+
vmin=None, vmax=None, alpha=None, linewidths=None, *,
4235+
edgecolors=None, plotnonfinite=False, **kwargs):
42394236
"""
42404237
A scatter plot of *y* vs. *x* with varying marker size and/or color.
42414238
@@ -5127,10 +5124,8 @@ def _fill_between_x_or_y(
51275124
else:
51285125
where = np.asarray(where, dtype=bool)
51295126
if where.size != ind.size:
5130-
cbook.warn_deprecated(
5131-
"3.2", message=f"Since %(since)s, the parameter *where* "
5132-
f"must have the same size as {ind} in {func_name}(). This "
5133-
"will become an error %(removal)s.")
5127+
raise ValueError(f"where size ({where.size}) does not match "
5128+
f"{ind_dir} size ({ind.size})")
51345129
where = where & ~functools.reduce(
51355130
np.logical_or, map(np.ma.getmask, [ind, dep1, dep2]))
51365131

lib/matplotlib/axes/_base.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,10 @@ def axis(self, *args, emit=True, **kwargs):
17811781
matplotlib.axes.Axes.set_xlim
17821782
matplotlib.axes.Axes.set_ylim
17831783
"""
1784-
if len(args) == 1 and isinstance(args[0], (str, bool)):
1784+
if len(args) > 1:
1785+
raise TypeError("axis() takes 0 or 1 positional arguments but "
1786+
f"{len(args)} were given")
1787+
elif len(args) == 1 and isinstance(args[0], (str, bool)):
17851788
s = args[0]
17861789
if s is True:
17871790
s = 'on'
@@ -1823,12 +1826,7 @@ def axis(self, *args, emit=True, **kwargs):
18231826
raise ValueError('Unrecognized string %s to axis; '
18241827
'try on or off' % s)
18251828
else:
1826-
if len(args) >= 1:
1827-
if len(args) != 1:
1828-
cbook.warn_deprecated(
1829-
"3.2", message="Passing more than one positional "
1830-
"argument to axis() is deprecated and will raise a "
1831-
"TypeError %(removal)s.")
1829+
if len(args) == 1:
18321830
limits = args[0]
18331831
try:
18341832
xmin, xmax, ymin, ymax = limits

lib/matplotlib/cbook/__init__.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,7 @@ def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None,
10561056
10571057
If a pair of floats, they indicate the percentiles at which to draw the
10581058
whiskers (e.g., (5, 95)). In particular, setting this to (0, 100)
1059-
results in whiskers covering the whole range of the data. "range" is
1060-
a deprecated synonym for (0, 100).
1059+
results in whiskers covering the whole range of the data.
10611060
10621061
In the edge case where ``Q1 == Q3``, *whis* is automatically set to
10631062
(0, 100) (cover the whole range of the data) if *autorange* is True.
@@ -1200,22 +1199,13 @@ def _compute_conf_interval(data, med, iqr, bootstrap):
12001199
)
12011200

12021201
# lowest/highest non-outliers
1203-
if np.isscalar(whis):
1204-
if np.isreal(whis):
1205-
loval = q1 - whis * stats['iqr']
1206-
hival = q3 + whis * stats['iqr']
1207-
elif whis in ['range', 'limit', 'limits', 'min/max']:
1208-
warn_deprecated(
1209-
"3.2", message=f"Setting whis to {whis!r} is deprecated "
1210-
"since %(since)s and support for it will be removed "
1211-
"%(removal)s; set it to [0, 100] to achieve the same "
1212-
"effect.")
1213-
loval = np.min(x)
1214-
hival = np.max(x)
1215-
else:
1216-
raise ValueError('whis must be a float or list of percentiles')
1217-
else:
1202+
if np.iterable(whis) and not isinstance(whis, str):
12181203
loval, hival = np.percentile(x, whis)
1204+
elif np.isreal(whis):
1205+
loval = q1 - whis * stats['iqr']
1206+
hival = q3 + whis * stats['iqr']
1207+
else:
1208+
raise ValueError('whis must be a float or list of percentiles')
12191209

12201210
# get high extreme
12211211
wiskhi = x[x <= hival]

lib/matplotlib/figure.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3166,9 +3166,7 @@ def execute_constrained_layout(self, renderer=None):
31663166
renderer = get_renderer(fig)
31673167
do_constrained_layout(fig, renderer, h_pad, w_pad, hspace, wspace)
31683168

3169-
@cbook._delete_parameter("3.2", "renderer")
3170-
def tight_layout(self, renderer=None, pad=1.08, h_pad=None, w_pad=None,
3171-
rect=None):
3169+
def tight_layout(self, *, pad=1.08, h_pad=None, w_pad=None, rect=None):
31723170
"""
31733171
Adjust the padding between and around subplots.
31743172
@@ -3178,8 +3176,6 @@ def tight_layout(self, renderer=None, pad=1.08, h_pad=None, w_pad=None,
31783176
31793177
Parameters
31803178
----------
3181-
renderer : subclass of `~.backend_bases.RendererBase`, optional
3182-
Defaults to the renderer for the figure. Deprecated.
31833179
pad : float, default: 1.08
31843180
Padding between the figure edge and the edges of subplots,
31853181
as a fraction of the font size.
@@ -3205,8 +3201,7 @@ def tight_layout(self, renderer=None, pad=1.08, h_pad=None, w_pad=None,
32053201
"compatible with tight_layout, so results "
32063202
"might be incorrect.")
32073203

3208-
if renderer is None:
3209-
renderer = get_renderer(self)
3204+
renderer = get_renderer(self)
32103205
ctx = (renderer._draw_disabled()
32113206
if hasattr(renderer, '_draw_disabled')
32123207
else suppress())

lib/matplotlib/pyplot.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,14 +2985,12 @@ def quiverkey(Q, X, Y, U, label, **kw):
29852985
@_copy_docstring_and_deprecators(Axes.scatter)
29862986
def scatter(
29872987
x, y, s=None, c=None, marker=None, cmap=None, norm=None,
2988-
vmin=None, vmax=None, alpha=None, linewidths=None,
2989-
verts=cbook.deprecation._deprecated_parameter,
2990-
edgecolors=None, *, plotnonfinite=False, data=None, **kwargs):
2988+
vmin=None, vmax=None, alpha=None, linewidths=None, *,
2989+
edgecolors=None, plotnonfinite=False, data=None, **kwargs):
29912990
__ret = gca().scatter(
29922991
x, y, s=s, c=c, marker=marker, cmap=cmap, norm=norm,
29932992
vmin=vmin, vmax=vmax, alpha=alpha, linewidths=linewidths,
2994-
verts=verts, edgecolors=edgecolors,
2995-
plotnonfinite=plotnonfinite,
2993+
edgecolors=edgecolors, plotnonfinite=plotnonfinite,
29962994
**({"data": data} if data is not None else {}), **kwargs)
29972995
sci(__ret)
29982996
return __ret

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def __init__(self, *args, orientation, **kwargs):
2525
self._locator = None # deprecated.
2626
super().__init__(*args, **kwargs)
2727

28-
@cbook._rename_parameter("3.2", "locator", "ticks")
2928
def colorbar(self, mappable, *, ticks=None, **kwargs):
3029

3130
if self.orientation in ["top", "bottom"]:

0 commit comments

Comments
 (0)