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

Skip to content

Commit 8236855

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 b87182d commit 8236855

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
@@ -1304,6 +1304,7 @@ def get_unit_generic(freq):
13041304
def _get_interval(self):
13051305
return self.rule._rrule._interval
13061306

1307+
@cbook.deprecated("3.1")
13071308
def autoscale(self):
13081309
"""
13091310
Set the view limits to include the data range.
@@ -1463,6 +1464,7 @@ def _get_unit(self):
14631464
else:
14641465
return RRuleLocator.get_unit_generic(self._freq)
14651466

1467+
@cbook.deprecated("3.1")
14661468
def autoscale(self):
14671469
'Try to choose the view limits intelligently.'
14681470
dmin, dmax = self.datalim_to_dt()
@@ -1641,6 +1643,7 @@ def tick_values(self, vmin, vmax):
16411643

16421644
ticks.append(dt)
16431645

1646+
@cbook.deprecated("3.1")
16441647
def autoscale(self):
16451648
"""
16461649
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
@@ -229,6 +229,7 @@ def __call__(self):
229229
else:
230230
return np.deg2rad(self.base())
231231

232+
@cbook.deprecated("3.1")
232233
def autoscale(self):
233234
return self.base.autoscale()
234235

@@ -417,6 +418,7 @@ def __call__(self):
417418
else:
418419
return [tick for tick in self.base() if tick > rorigin]
419420

421+
@cbook.deprecated("3.1")
420422
def autoscale(self):
421423
return self.base.autoscale()
422424

lib/matplotlib/ticker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,7 @@ def view_limits(self, vmin, vmax):
14751475
"""
14761476
return mtransforms.nonsingular(vmin, vmax)
14771477

1478+
@cbook.deprecated("3.1")
14781479
def autoscale(self):
14791480
"""autoscale the view limits"""
14801481
return self.view_limits(*self.axis.get_view_interval())

0 commit comments

Comments
 (0)