Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b51a756

Browse files
committed
Remove deprecated pan/zoom methods.
1 parent a94acb3 commit b51a756

File tree

4 files changed

+5
-49
lines changed

4 files changed

+5
-49
lines changed

doc/api/axis_api.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,6 @@ Units
169169
Axis.update_units
170170

171171

172-
Incremental navigation
173-
----------------------
174-
175-
.. autosummary::
176-
:toctree: _as_gen
177-
:template: autosummary.rst
178-
:nosignatures:
179-
180-
Axis.pan
181-
Axis.zoom
182-
183172
XAxis Specific
184173
--------------
185174

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Axis and Locator ``pan`` and ``zoom``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
The unused ``pan`` and ``zoom`` methods of `~.axis.Axis` and `~.ticker.Locator`
4+
have been removed. Panning and zooming are now implemented using the
5+
``start_pan``, ``drag_pan``, and ``end_pan`` methods of `~.axes.Axes`.

lib/matplotlib/axis.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,16 +1867,6 @@ def _update_offset_text_position(self, bboxes, bboxes2):
18671867
"""
18681868
raise NotImplementedError('Derived must override')
18691869

1870-
@_api.deprecated("3.3")
1871-
def pan(self, numsteps):
1872-
"""Pan by *numsteps* (can be positive or negative)."""
1873-
self.major.locator.pan(numsteps)
1874-
1875-
@_api.deprecated("3.3")
1876-
def zoom(self, direction):
1877-
"""Zoom in/out on axis; if *direction* is >0 zoom in, else zoom out."""
1878-
self.major.locator.zoom(direction)
1879-
18801870
def axis_date(self, tz=None):
18811871
"""
18821872
Set up axis ticks and labels to treat data along this Axis as dates.

lib/matplotlib/ticker.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,34 +1776,6 @@ def view_limits(self, vmin, vmax):
17761776
"""
17771777
return mtransforms.nonsingular(vmin, vmax)
17781778

1779-
@_api.deprecated("3.3")
1780-
def pan(self, numsteps):
1781-
"""Pan numticks (can be positive or negative)"""
1782-
ticks = self()
1783-
numticks = len(ticks)
1784-
1785-
vmin, vmax = self.axis.get_view_interval()
1786-
vmin, vmax = mtransforms.nonsingular(vmin, vmax, expander=0.05)
1787-
if numticks > 2:
1788-
step = numsteps * abs(ticks[0] - ticks[1])
1789-
else:
1790-
d = abs(vmax - vmin)
1791-
step = numsteps * d / 6.
1792-
1793-
vmin += step
1794-
vmax += step
1795-
self.axis.set_view_interval(vmin, vmax, ignore=True)
1796-
1797-
@_api.deprecated("3.3")
1798-
def zoom(self, direction):
1799-
"""Zoom in/out on axis; if direction is >0 zoom in, else zoom out."""
1800-
1801-
vmin, vmax = self.axis.get_view_interval()
1802-
vmin, vmax = mtransforms.nonsingular(vmin, vmax, expander=0.05)
1803-
interval = abs(vmax - vmin)
1804-
step = 0.1 * interval * direction
1805-
self.axis.set_view_interval(vmin + step, vmax - step, ignore=True)
1806-
18071779
@_api.deprecated("3.3")
18081780
def refresh(self):
18091781
"""Refresh internal information based on current limits."""

0 commit comments

Comments
 (0)