Skip to content

Commit a70d650

Browse files
authored
Merge pull request matplotlib#28183 from oscargus/axisandmore
Expire deprecations
2 parents 0cf6e20 + f6b8a1b commit a70d650

File tree

22 files changed

+85
-168
lines changed

22 files changed

+85
-168
lines changed

doc/api/axis_api.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ Other
217217
Axis.axes
218218
Axis.limit_range_for_scale
219219
Axis.reset_ticks
220+
Axis.set_clip_path
220221
Axis.set_default_intervals
221222

222223
Discouraged
@@ -263,8 +264,7 @@ specify a matching series of labels. Calling ``set_ticks`` makes a
263264
Tick.get_tick_padding
264265
Tick.get_tickdir
265266
Tick.get_view_interval
266-
Tick.set_label1
267-
Tick.set_label2
267+
Tick.set_clip_path
268268
Tick.set_pad
269269
Tick.set_url
270270
Tick.update_position
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
``Tick.set_label``, ``Tick.set_label1`` and ``Tick.set_label2``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... are removed. Calling these methods from third-party code usually had no
4+
effect, as the labels are overwritten at draw time by the tick formatter.
5+
6+
7+
Functions in ``mpl_toolkits.mplot3d.proj3d``
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
The function ``transform`` is just an alias for ``proj_transform``,
11+
use the latter instead.
12+
13+
The following functions were either unused (so no longer required in Matplotlib)
14+
or considered private.
15+
16+
* ``ortho_transformation``
17+
* ``persp_transformation``
18+
* ``proj_points``
19+
* ``proj_trans_points``
20+
* ``rot_x``
21+
* ``rotation_about_vector``
22+
* ``view_transformation``
23+
24+
25+
Arguments other than ``renderer`` to ``get_tightbbox``
26+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
28+
... are keyword-only arguments. This is for consistency and that
29+
different classes have different additional arguments.
30+
31+
32+
Method parameters renamed to match base classes
33+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34+
35+
The only parameter of ``transform_affine`` and ``transform_non_affine`` in ``Transform`` subclasses is renamed
36+
to *values*.
37+
38+
The *points* parameter of ``transforms.IdentityTransform.transform`` is renamed to *values*.
39+
40+
The *trans* parameter of ``table.Cell.set_transform`` is renamed to *t* consistently with
41+
`.Artist.set_transform`.
42+
43+
The *clippath* parameters of ``axis.Axis.set_clip_path`` and ``axis.Tick.set_clip_path`` are
44+
renamed to *path* consistently with `.Artist.set_clip_path`.
45+
46+
The *s* parameter of ``images.NonUniformImage.set_filternorm`` is renamed to *filternorm*
47+
consistently with ``_ImageBase.set_filternorm``.
48+
49+
The *s* parameter of ``images.NonUniformImage.set_filterrad`` is renamed to *filterrad*
50+
consistently with ``_ImageBase.set_filterrad``.
51+
52+
The only parameter of ``Annotation.contains`` and ``Legend.contains`` is renamed to *mouseevent*
53+
consistently with `.Artist.contains`.
54+
55+
Method parameters renamed
56+
~~~~~~~~~~~~~~~~~~~~~~~~~
57+
58+
The *p* parameter of ``BboxBase.padded`` is renamed to *w_pad*, consistently with the other parameter, *h_pad*
59+
60+
*numdecs* parameter and attribute of ``LogLocator``
61+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62+
... are removed without replacement, because they had no effect.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ The *clippath* parameters of ``axis.Axis.set_clip_path`` and ``axis.Tick.set_cl
153153
renamed to *path* consistently with `.Artist.set_clip_path`.
154154

155155
The *s* parameter of ``images.NonUniformImage.set_filternorm`` is renamed to *filternorm*
156-
consistently with ```_ImageBase.set_filternorm``.
156+
consistently with ``_ImageBase.set_filternorm``.
157157

158158
The *s* parameter of ``images.NonUniformImage.set_filterrad`` is renamed to *filterrad*
159-
consistently with ```_ImageBase.set_filterrad``.
159+
consistently with ``_ImageBase.set_filterrad``.
160160

161161

162162
*numdecs* parameter and attribute of ``LogLocator``

doc/api/toolkits/mplot3d.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ the toolbar pan and zoom buttons are not used.
118118
:template: autosummary.rst
119119

120120
proj3d.inv_transform
121-
proj3d.persp_transformation
122-
proj3d.proj_points
123-
proj3d.proj_trans_points
124121
proj3d.proj_transform
125122
proj3d.proj_transform_clip
126-
proj3d.rot_x
127-
proj3d.transform
128-
proj3d.view_transformation
129123
proj3d.world_transformation

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4425,9 +4425,8 @@ def get_default_bbox_extra_artists(self):
44254425
return [a for a in artists if a.get_visible() and a.get_in_layout()
44264426
and (isinstance(a, noclip) or not a._fully_clipped_to_axes())]
44274427

4428-
@_api.make_keyword_only("3.8", "call_axes_locator")
4429-
def get_tightbbox(self, renderer=None, call_axes_locator=True,
4430-
bbox_extra_artists=None, *, for_layout_only=False):
4428+
def get_tightbbox(self, renderer=None, *, call_axes_locator=True,
4429+
bbox_extra_artists=None, for_layout_only=False):
44314430
"""
44324431
Return the tight bounding box of the Axes, including axis and their
44334432
decorators (xlabel, title, etc).

lib/matplotlib/axis.py

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ def get_children(self):
231231
self.gridline, self.label1, self.label2]
232232
return children
233233

234-
@_api.rename_parameter("3.8", "clippath", "path")
235234
def set_clip_path(self, path, transform=None):
236235
# docstring inherited
237236
super().set_clip_path(path, transform)
@@ -278,32 +277,6 @@ def draw(self, renderer):
278277
renderer.close_group(self.__name__)
279278
self.stale = False
280279

281-
@_api.deprecated("3.8")
282-
def set_label1(self, s):
283-
"""
284-
Set the label1 text.
285-
286-
Parameters
287-
----------
288-
s : str
289-
"""
290-
self.label1.set_text(s)
291-
self.stale = True
292-
293-
set_label = set_label1
294-
295-
@_api.deprecated("3.8")
296-
def set_label2(self, s):
297-
"""
298-
Set the label2 text.
299-
300-
Parameters
301-
----------
302-
s : str
303-
"""
304-
self.label2.set_text(s)
305-
self.stale = True
306-
307280
def set_url(self, url):
308281
"""
309282
Set the url of label1 and label2.
@@ -833,6 +806,10 @@ def _set_axes_scale(self, value, **kwargs):
833806
**{f"scale{k}": k == name for k in self.axes._axis_names})
834807

835808
def limit_range_for_scale(self, vmin, vmax):
809+
"""
810+
Return the range *vmin*, *vmax*, restricted to the domain supported by the
811+
current scale.
812+
"""
836813
return self._scale.limit_range_for_scale(vmin, vmax, self.get_minpos())
837814

838815
def _get_autoscale_on(self):
@@ -841,8 +818,9 @@ def _get_autoscale_on(self):
841818

842819
def _set_autoscale_on(self, b):
843820
"""
844-
Set whether this Axis is autoscaled when drawing or by
845-
`.Axes.autoscale_view`. If b is None, then the value is not changed.
821+
Set whether this Axis is autoscaled when drawing or by `.Axes.autoscale_view`.
822+
823+
If b is None, then the value is not changed.
846824
847825
Parameters
848826
----------
@@ -1131,7 +1109,6 @@ def _translate_tick_params(kw, reverse=False):
11311109
kwtrans.update(kw_)
11321110
return kwtrans
11331111

1134-
@_api.rename_parameter("3.8", "clippath", "path")
11351112
def set_clip_path(self, path, transform=None):
11361113
super().set_clip_path(path, transform)
11371114
for child in self.majorTicks + self.minorTicks:

lib/matplotlib/axis.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ class Tick(martist.Artist):
6060
def set_pad(self, val: float) -> None: ...
6161
def get_pad(self) -> None: ...
6262
def get_loc(self) -> float: ...
63-
def set_label1(self, s: object) -> None: ...
64-
def set_label(self, s: object) -> None: ...
65-
def set_label2(self, s: object) -> None: ...
6663
def set_url(self, url: str | None) -> None: ...
6764
def get_view_interval(self) -> ArrayLike: ...
6865
def update_position(self, loc: float) -> None: ...

lib/matplotlib/figure.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,8 +1797,7 @@ def get_default_bbox_extra_artists(self):
17971797
bbox_artists.extend(ax.get_default_bbox_extra_artists())
17981798
return bbox_artists
17991799

1800-
@_api.make_keyword_only("3.8", "bbox_extra_artists")
1801-
def get_tightbbox(self, renderer=None, bbox_extra_artists=None):
1800+
def get_tightbbox(self, renderer=None, *, bbox_extra_artists=None):
18021801
"""
18031802
Return a (tight) bounding box of the figure *in inches*.
18041803

lib/matplotlib/image.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,11 +1129,9 @@ def get_extent(self):
11291129
raise RuntimeError('Must set data first')
11301130
return self._Ax[0], self._Ax[-1], self._Ay[0], self._Ay[-1]
11311131

1132-
@_api.rename_parameter("3.8", "s", "filternorm")
11331132
def set_filternorm(self, filternorm):
11341133
pass
11351134

1136-
@_api.rename_parameter("3.8", "s", "filterrad")
11371135
def set_filterrad(self, filterrad):
11381136
pass
11391137

lib/matplotlib/legend.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,6 @@ def _find_best_position(self, width, height, renderer):
11961196

11971197
return l, b
11981198

1199-
@_api.rename_parameter("3.8", "event", "mouseevent")
12001199
def contains(self, mouseevent):
12011200
return self.legendPatch.contains(mouseevent)
12021201

0 commit comments

Comments
 (0)