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

Skip to content

Commit 97b9c9a

Browse files
committed
Deprecate Locator.autoscale.
Note that this likely indicates that the dates Locators need new implementations of view_limits, as they appear to never have been updated to use the "new" (post-2008) API.
1 parent 4a5c939 commit 97b9c9a

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
The unused `Locator.autoscale()` method is deprecated (pass the axis limits to
5+
`Locator.view_limits()` instead).

lib/matplotlib/dates.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,7 @@ def get_unit_generic(freq):
11961196
def _get_interval(self):
11971197
return self.rule._rrule._interval
11981198

1199+
@cbook.deprecated("3.2")
11991200
def autoscale(self):
12001201
"""
12011202
Set the view limits to include the data range.
@@ -1355,6 +1356,7 @@ def _get_unit(self):
13551356
else:
13561357
return RRuleLocator.get_unit_generic(self._freq)
13571358

1359+
@cbook.deprecated("3.2")
13581360
def autoscale(self):
13591361
'Try to choose the view limits intelligently.'
13601362
dmin, dmax = self.datalim_to_dt()
@@ -1531,6 +1533,7 @@ def tick_values(self, vmin, vmax):
15311533

15321534
ticks.append(dt)
15331535

1536+
@cbook.deprecated("3.2")
15341537
def autoscale(self):
15351538
"""
15361539
Set the view limits to include the data range.

lib/matplotlib/projections/polar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ def __call__(self):
225225
else:
226226
return np.deg2rad(self.base())
227227

228+
@cbook.deprecated("3.2")
228229
def autoscale(self):
229230
return self.base.autoscale()
230231

@@ -414,6 +415,7 @@ def __call__(self):
414415
else:
415416
return [tick for tick in self.base() if tick > rorigin]
416417

418+
@cbook.deprecated("3.2")
417419
def autoscale(self):
418420
return self.base.autoscale()
419421

lib/matplotlib/ticker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,7 @@ def view_limits(self, vmin, vmax):
15311531
"""
15321532
return mtransforms.nonsingular(vmin, vmax)
15331533

1534+
@cbook.deprecated("3.2")
15341535
def autoscale(self):
15351536
"""Autoscale the view limits."""
15361537
return self.view_limits(*self.axis.get_view_interval())

0 commit comments

Comments
 (0)