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

Skip to content

Commit 1143143

Browse files
authored
Merge pull request #16652 from anntzer/locaxispanzoom
Deprecate {Locator,Axis}.{pan,zoom}.
2 parents 0abc553 + 6562544 commit 1143143

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

doc/api/next_api_changes/deprecations.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,9 @@ Such options should now be directly passed to Pillow using
311311
``dviread.Encoding``
312312
~~~~~~~~~~~~~~~~~~~~
313313
This class was (mostly) broken and is deprecated.
314+
315+
Axis and Locator ``pan`` and ``zoom``
316+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317+
The unused ``pan`` and ``zoom`` methods of `~.axis.Axis` and `~.ticker.Locator`
318+
are deprecated. Panning and zooming are now implemented using the
319+
``start_pan``, ``drag_pan``, and ``end_pan`` methods of `~.axes.Axes`.

lib/matplotlib/axis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,10 +1708,12 @@ def _update_offset_text_position(self, bboxes, bboxes2):
17081708
"""
17091709
raise NotImplementedError('Derived must override')
17101710

1711+
@cbook.deprecated("3.3")
17111712
def pan(self, numsteps):
17121713
"""Pan by *numsteps* (can be positive or negative)."""
17131714
self.major.locator.pan(numsteps)
17141715

1716+
@cbook.deprecated("3.3")
17151717
def zoom(self, direction):
17161718
"""Zoom in/out on axis; if *direction* is >0 zoom in, else zoom out."""
17171719
self.major.locator.zoom(direction)

lib/matplotlib/projections/polar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def __call__(self):
203203
def autoscale(self):
204204
return self.base.autoscale()
205205

206+
@cbook.deprecated("3.3")
206207
def pan(self, numsteps):
207208
return self.base.pan(numsteps)
208209

@@ -214,6 +215,7 @@ def view_limits(self, vmin, vmax):
214215
vmin, vmax = np.rad2deg((vmin, vmax))
215216
return np.deg2rad(self.base.view_limits(vmin, vmax))
216217

218+
@cbook.deprecated("3.3")
217219
def zoom(self, direction):
218220
return self.base.zoom(direction)
219221

@@ -387,9 +389,11 @@ def __call__(self):
387389
def autoscale(self):
388390
return self.base.autoscale()
389391

392+
@cbook.deprecated("3.3")
390393
def pan(self, numsteps):
391394
return self.base.pan(numsteps)
392395

396+
@cbook.deprecated("3.3")
393397
def zoom(self, direction):
394398
return self.base.zoom(direction)
395399

lib/matplotlib/ticker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@ def autoscale(self):
16441644
"""Autoscale the view limits."""
16451645
return self.view_limits(*self.axis.get_view_interval())
16461646

1647+
@cbook.deprecated("3.3")
16471648
def pan(self, numsteps):
16481649
"""Pan numticks (can be positive or negative)"""
16491650
ticks = self()
@@ -1661,6 +1662,7 @@ def pan(self, numsteps):
16611662
vmax += step
16621663
self.axis.set_view_interval(vmin, vmax, ignore=True)
16631664

1665+
@cbook.deprecated("3.3")
16641666
def zoom(self, direction):
16651667
"""Zoom in/out on axis; if direction is >0 zoom in, else zoom out."""
16661668

0 commit comments

Comments
 (0)