@@ -1422,7 +1422,10 @@ class Locator(TickHelper):
1422
1422
# kill the machine when you try and render them.
1423
1423
# This parameter is set to cause locators to raise an error if too
1424
1424
# many ticks are generated.
1425
- MAXTICKS = 1000
1425
+ @property
1426
+ @cbook .deprecated ("2.1" )
1427
+ def MAXTICKS (self ):
1428
+ return 1000
1426
1429
1427
1430
def tick_values (self , vmin , vmax ):
1428
1431
"""
@@ -1455,6 +1458,7 @@ def __call__(self):
1455
1458
# hence there is no *one* interface to call self.tick_values.
1456
1459
raise NotImplementedError ('Derived must override' )
1457
1460
1461
+ @cbook .deprecated ("2.1" )
1458
1462
def raise_if_exceeds (self , locs ):
1459
1463
"""raise a RuntimeError if Locator attempts to create more than
1460
1464
MAXTICKS locs"""
@@ -1581,7 +1585,7 @@ def tick_values(self, vmin, vmax):
1581
1585
ticks1 = self .locs [i ::step ]
1582
1586
if np .abs (ticks1 ).min () < np .abs (ticks ).min ():
1583
1587
ticks = ticks1
1584
- return self . raise_if_exceeds ( ticks )
1588
+ return ticks
1585
1589
1586
1590
1587
1591
class NullLocator (Locator ):
@@ -1640,18 +1644,14 @@ def tick_values(self, vmin, vmax):
1640
1644
vmin , vmax = mtransforms .nonsingular (vmin , vmax , expander = 0.05 )
1641
1645
if vmax < vmin :
1642
1646
vmin , vmax = vmax , vmin
1643
-
1644
1647
if (vmin , vmax ) in self .presets :
1645
1648
return self .presets [(vmin , vmax )]
1646
-
1647
1649
if self .numticks is None :
1648
1650
self ._set_numticks ()
1649
-
1650
1651
if self .numticks == 0 :
1651
1652
return []
1652
1653
ticklocs = np .linspace (vmin , vmax , self .numticks )
1653
-
1654
- return self .raise_if_exceeds (ticklocs )
1654
+ return ticklocs
1655
1655
1656
1656
def _set_numticks (self ):
1657
1657
self .numticks = 11 # todo; be smart here; this is just for dev
@@ -1751,7 +1751,7 @@ def tick_values(self, vmin, vmax):
1751
1751
base = self ._base .get_base ()
1752
1752
n = (vmax - vmin + 0.001 * base ) // base
1753
1753
locs = vmin - base + np .arange (n + 3 ) * base
1754
- return self . raise_if_exceeds ( locs )
1754
+ return locs
1755
1755
1756
1756
def view_limits (self , dmin , dmax ):
1757
1757
"""
@@ -1966,7 +1966,7 @@ def tick_values(self, vmin, vmax):
1966
1966
locs = locs [:- 1 ]
1967
1967
elif prune == 'both' :
1968
1968
locs = locs [1 :- 1 ]
1969
- return self . raise_if_exceeds ( locs )
1969
+ return locs
1970
1970
1971
1971
def view_limits (self , dmin , dmax ):
1972
1972
if self ._symmetric :
@@ -2174,7 +2174,7 @@ def tick_values(self, vmin, vmax):
2174
2174
else :
2175
2175
ticklocs = b ** decades
2176
2176
2177
- return self . raise_if_exceeds ( np .asarray (ticklocs ) )
2177
+ return np .asarray (ticklocs )
2178
2178
2179
2179
def view_limits (self , vmin , vmax ):
2180
2180
'Try to choose the view limits intelligently'
@@ -2355,7 +2355,7 @@ def get_log_range(lo, hi):
2355
2355
else :
2356
2356
ticklocs = decades
2357
2357
2358
- return self . raise_if_exceeds ( np .array (ticklocs ) )
2358
+ return np .array (ticklocs )
2359
2359
2360
2360
def view_limits (self , vmin , vmax ):
2361
2361
'Try to choose the view limits intelligently'
@@ -2446,7 +2446,7 @@ def tick_values(self, vmin, vmax):
2446
2446
newticks = 1 - np .outer (np .arange (2 , 10 ), 10 ** expo ).ravel ()
2447
2447
ticklocs .extend (list (newticks ))
2448
2448
2449
- return self . raise_if_exceeds ( np .array (ticklocs ) )
2449
+ return np .array (ticklocs )
2450
2450
2451
2451
def nonsingular (self , vmin , vmax ):
2452
2452
initial_range = (1e-7 , 1 - 1e-7 )
@@ -2553,7 +2553,7 @@ def __call__(self):
2553
2553
cond = np .abs ((locs - t0 ) % majorstep ) > minorstep / 10.0
2554
2554
locs = locs .compress (cond )
2555
2555
2556
- return self . raise_if_exceeds ( np .array (locs ) )
2556
+ return np .array (locs )
2557
2557
2558
2558
def tick_values (self , vmin , vmax ):
2559
2559
raise NotImplementedError ('Cannot get tick locations for a '
@@ -2572,7 +2572,7 @@ def __init__(self):
2572
2572
def __call__ (self ):
2573
2573
'Return the locations of the ticks'
2574
2574
self .refresh ()
2575
- return self .raise_if_exceeds ( self . _locator () )
2575
+ return self ._locator ()
2576
2576
2577
2577
def tick_values (self , vmin , vmax ):
2578
2578
raise NotImplementedError ('Cannot get tick locations for a '
0 commit comments