Skip to content

Commit a5ba87a

Browse files
committed
Remove deprecations in toolkits
1 parent 65878f3 commit a5ba87a

File tree

9 files changed

+3
-196
lines changed

9 files changed

+3
-196
lines changed

lib/mpl_toolkits/axes_grid1/axes_divider.py

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -199,31 +199,6 @@ def new_locator(self, nx, ny, nx1=None, ny1=None):
199199
locator.get_subplotspec = self.get_subplotspec
200200
return locator
201201

202-
@_api.deprecated(
203-
"3.8", alternative="divider.new_locator(...)(ax, renderer)")
204-
def locate(self, nx, ny, nx1=None, ny1=None, axes=None, renderer=None):
205-
"""
206-
Implementation of ``divider.new_locator().__call__``.
207-
208-
Parameters
209-
----------
210-
nx, nx1 : int
211-
Integers specifying the column-position of the cell. When *nx1* is
212-
None, a single *nx*-th column is specified. Otherwise, the
213-
location of columns spanning between *nx* to *nx1* (but excluding
214-
*nx1*-th column) is specified.
215-
ny, ny1 : int
216-
Same as *nx* and *nx1*, but for row positions.
217-
axes
218-
renderer
219-
"""
220-
xref = self._xrefindex
221-
yref = self._yrefindex
222-
return self._locate(
223-
nx - xref, (nx + 1 if nx1 is None else nx1) - xref,
224-
ny - yref, (ny + 1 if ny1 is None else ny1) - yref,
225-
axes, renderer)
226-
227202
def _locate(self, nx, ny, nx1, ny1, axes, renderer):
228203
"""
229204
Implementation of ``divider.new_locator().__call__``.
@@ -305,57 +280,6 @@ def add_auto_adjustable_area(self, use_axes, pad=0.1, adjust_dirs=None):
305280
self.append_size(d, Size._AxesDecorationsSize(use_axes, d) + pad)
306281

307282

308-
@_api.deprecated("3.8")
309-
class AxesLocator:
310-
"""
311-
A callable object which returns the position and size of a given
312-
`.AxesDivider` cell.
313-
"""
314-
315-
def __init__(self, axes_divider, nx, ny, nx1=None, ny1=None):
316-
"""
317-
Parameters
318-
----------
319-
axes_divider : `~mpl_toolkits.axes_grid1.axes_divider.AxesDivider`
320-
nx, nx1 : int
321-
Integers specifying the column-position of the
322-
cell. When *nx1* is None, a single *nx*-th column is
323-
specified. Otherwise, location of columns spanning between *nx*
324-
to *nx1* (but excluding *nx1*-th column) is specified.
325-
ny, ny1 : int
326-
Same as *nx* and *nx1*, but for row positions.
327-
"""
328-
self._axes_divider = axes_divider
329-
330-
_xrefindex = axes_divider._xrefindex
331-
_yrefindex = axes_divider._yrefindex
332-
333-
self._nx, self._ny = nx - _xrefindex, ny - _yrefindex
334-
335-
if nx1 is None:
336-
nx1 = len(self._axes_divider)
337-
if ny1 is None:
338-
ny1 = len(self._axes_divider[0])
339-
340-
self._nx1 = nx1 - _xrefindex
341-
self._ny1 = ny1 - _yrefindex
342-
343-
def __call__(self, axes, renderer):
344-
345-
_xrefindex = self._axes_divider._xrefindex
346-
_yrefindex = self._axes_divider._yrefindex
347-
348-
return self._axes_divider.locate(self._nx + _xrefindex,
349-
self._ny + _yrefindex,
350-
self._nx1 + _xrefindex,
351-
self._ny1 + _yrefindex,
352-
axes,
353-
renderer)
354-
355-
def get_subplotspec(self):
356-
return self._axes_divider.get_subplotspec()
357-
358-
359283
class SubplotDivider(Divider):
360284
"""
361285
The Divider class whose rectangle area is specified as a subplot geometry.

lib/mpl_toolkits/axes_grid1/axes_grid.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ def colorbar(self, mappable, **kwargs):
2020
return self.get_figure(root=False).colorbar(
2121
mappable, cax=self, location=self.orientation, **kwargs)
2222

23-
@_api.deprecated("3.8", alternative="ax.tick_params and colorbar.set_label")
24-
def toggle_label(self, b):
25-
axis = self.axis[self.orientation]
26-
axis.toggle(ticklabels=b, label=b)
27-
2823

2924
_cbaraxes_class_factory = cbook._make_class_factory(CbarAxesBase, "Cbar{}")
3025

lib/mpl_toolkits/axes_grid1/inset_locator.py

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,58 +6,13 @@
66
from matplotlib.offsetbox import AnchoredOffsetbox
77
from matplotlib.patches import Patch, Rectangle
88
from matplotlib.path import Path
9-
from matplotlib.transforms import Bbox, BboxTransformTo
9+
from matplotlib.transforms import Bbox
1010
from matplotlib.transforms import IdentityTransform, TransformedBbox
1111

1212
from . import axes_size as Size
1313
from .parasite_axes import HostAxes
1414

1515

16-
@_api.deprecated("3.8", alternative="Axes.inset_axes")
17-
class InsetPosition:
18-
@_docstring.interpd
19-
def __init__(self, parent, lbwh):
20-
"""
21-
An object for positioning an inset axes.
22-
23-
This is created by specifying the normalized coordinates in the axes,
24-
instead of the figure.
25-
26-
Parameters
27-
----------
28-
parent : `~matplotlib.axes.Axes`
29-
Axes to use for normalizing coordinates.
30-
31-
lbwh : iterable of four floats
32-
The left edge, bottom edge, width, and height of the inset axes, in
33-
units of the normalized coordinate of the *parent* axes.
34-
35-
See Also
36-
--------
37-
:meth:`matplotlib.axes.Axes.set_axes_locator`
38-
39-
Examples
40-
--------
41-
The following bounds the inset axes to a box with 20%% of the parent
42-
axes height and 40%% of the width. The size of the axes specified
43-
([0, 0, 1, 1]) ensures that the axes completely fills the bounding box:
44-
45-
>>> parent_axes = plt.gca()
46-
>>> ax_ins = plt.axes([0, 0, 1, 1])
47-
>>> ip = InsetPosition(parent_axes, [0.5, 0.1, 0.4, 0.2])
48-
>>> ax_ins.set_axes_locator(ip)
49-
"""
50-
self.parent = parent
51-
self.lbwh = lbwh
52-
53-
def __call__(self, ax, renderer):
54-
bbox_parent = self.parent.get_position(original=False)
55-
trans = BboxTransformTo(bbox_parent)
56-
bbox_inset = Bbox.from_bounds(*self.lbwh)
57-
bb = TransformedBbox(bbox_inset, trans)
58-
return bb
59-
60-
6116
class AnchoredLocatorBase(AnchoredOffsetbox):
6217
def __init__(self, bbox_to_anchor, offsetbox, loc,
6318
borderpad=0.5, bbox_transform=None):

lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@
1818
host_subplot, make_axes_locatable,
1919
Grid, AxesGrid, ImageGrid)
2020
from mpl_toolkits.axes_grid1.anchored_artists import (
21-
AnchoredAuxTransformBox, AnchoredDrawingArea, AnchoredEllipse,
21+
AnchoredAuxTransformBox, AnchoredDrawingArea,
2222
AnchoredDirectionArrows, AnchoredSizeBar)
2323
from mpl_toolkits.axes_grid1.axes_divider import (
2424
Divider, HBoxDivider, make_axes_area_auto_adjustable, SubplotDivider,
2525
VBoxDivider)
2626
from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes
2727
from mpl_toolkits.axes_grid1.inset_locator import (
28-
zoomed_inset_axes, mark_inset, inset_axes, BboxConnectorPatch,
29-
InsetPosition)
28+
zoomed_inset_axes, mark_inset, inset_axes, BboxConnectorPatch)
3029
import mpl_toolkits.axes_grid1.mpl_axes
3130
import pytest
3231

lib/mpl_toolkits/axisartist/axes_grid.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

lib/mpl_toolkits/axisartist/axes_rgb.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

lib/mpl_toolkits/axisartist/axislines.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,6 @@ def get_gridlines(self, which="major", axis="both"):
370370

371371
class Axes(maxes.Axes):
372372

373-
@_api.deprecated("3.8", alternative="ax.axis")
374-
def __call__(self, *args, **kwargs):
375-
return maxes.Axes.axis(self.axes, *args, **kwargs)
376-
377373
def __init__(self, *args, grid_helper=None, **kwargs):
378374
self._axisline_on = True
379375
self._grid_helper = grid_helper if grid_helper else GridHelperRectlinear(self)

lib/mpl_toolkits/axisartist/floating_axes.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,6 @@ def __init__(self, aux_trans, extremes,
147147
tick_formatter1=tick_formatter1,
148148
tick_formatter2=tick_formatter2)
149149

150-
@_api.deprecated("3.8")
151-
def get_data_boundary(self, side):
152-
"""
153-
Return v=0, nth=1.
154-
"""
155-
lon1, lon2, lat1, lat2 = self.grid_finder.extreme_finder(*[None] * 5)
156-
return dict(left=(lon1, 0),
157-
right=(lon2, 0),
158-
bottom=(lat1, 1),
159-
top=(lat2, 1))[side]
160-
161150
def new_fixed_axis(
162151
self, loc, nth_coord=None, axis_direction=None, offset=None, axes=None):
163152
if axes is None:

lib/mpl_toolkits/mplot3d/axis3d.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ def set_ticks_position(self, position):
195195
position : {'lower', 'upper', 'both', 'default', 'none'}
196196
The position of the bolded axis lines, ticks, and tick labels.
197197
"""
198-
if position in ['top', 'bottom']:
199-
_api.warn_deprecated('3.8', name=f'{position=}',
200-
obj_type='argument value',
201-
alternative="'upper' or 'lower'")
202-
return
203198
_api.check_in_list(['lower', 'upper', 'both', 'default', 'none'],
204199
position=position)
205200
self._tick_position = position
@@ -224,11 +219,6 @@ def set_label_position(self, position):
224219
position : {'lower', 'upper', 'both', 'default', 'none'}
225220
The position of the axis label.
226221
"""
227-
if position in ['top', 'bottom']:
228-
_api.warn_deprecated('3.8', name=f'{position=}',
229-
obj_type='argument value',
230-
alternative="'upper' or 'lower'")
231-
return
232222
_api.check_in_list(['lower', 'upper', 'both', 'default', 'none'],
233223
position=position)
234224
self._label_position = position

0 commit comments

Comments
 (0)