@@ -1396,7 +1396,10 @@ class Locator(TickHelper):
1396
1396
# kill the machine when you try and render them.
1397
1397
# This parameter is set to cause locators to raise an error if too
1398
1398
# many ticks are generated.
1399
- MAXTICKS = 1000
1399
+ @property
1400
+ @cbook .deprecated ("2.1" )
1401
+ def MAXTICKS (self ):
1402
+ return 1000
1400
1403
1401
1404
def tick_values (self , vmin , vmax ):
1402
1405
"""
@@ -1429,6 +1432,7 @@ def __call__(self):
1429
1432
# hence there is no *one* interface to call self.tick_values.
1430
1433
raise NotImplementedError ('Derived must override' )
1431
1434
1435
+ @cbook .deprecated ("2.1" )
1432
1436
def raise_if_exceeds (self , locs ):
1433
1437
"""raise a RuntimeError if Locator attempts to create more than
1434
1438
MAXTICKS locs"""
@@ -1555,7 +1559,7 @@ def tick_values(self, vmin, vmax):
1555
1559
ticks1 = self .locs [i ::step ]
1556
1560
if np .abs (ticks1 ).min () < np .abs (ticks ).min ():
1557
1561
ticks = ticks1
1558
- return self . raise_if_exceeds ( ticks )
1562
+ return ticks
1559
1563
1560
1564
1561
1565
class NullLocator (Locator ):
@@ -1614,18 +1618,14 @@ def tick_values(self, vmin, vmax):
1614
1618
vmin , vmax = mtransforms .nonsingular (vmin , vmax , expander = 0.05 )
1615
1619
if vmax < vmin :
1616
1620
vmin , vmax = vmax , vmin
1617
-
1618
1621
if (vmin , vmax ) in self .presets :
1619
1622
return self .presets [(vmin , vmax )]
1620
-
1621
1623
if self .numticks is None :
1622
1624
self ._set_numticks ()
1623
-
1624
1625
if self .numticks == 0 :
1625
1626
return []
1626
1627
ticklocs = np .linspace (vmin , vmax , self .numticks )
1627
-
1628
- return self .raise_if_exceeds (ticklocs )
1628
+ return ticklocs
1629
1629
1630
1630
def _set_numticks (self ):
1631
1631
self .numticks = 11 # todo; be smart here; this is just for dev
@@ -1725,7 +1725,7 @@ def tick_values(self, vmin, vmax):
1725
1725
base = self ._base .get_base ()
1726
1726
n = (vmax - vmin + 0.001 * base ) // base
1727
1727
locs = vmin - base + np .arange (n + 3 ) * base
1728
- return self . raise_if_exceeds ( locs )
1728
+ return locs
1729
1729
1730
1730
def view_limits (self , dmin , dmax ):
1731
1731
"""
@@ -1940,7 +1940,7 @@ def tick_values(self, vmin, vmax):
1940
1940
locs = locs [:- 1 ]
1941
1941
elif prune == 'both' :
1942
1942
locs = locs [1 :- 1 ]
1943
- return self . raise_if_exceeds ( locs )
1943
+ return locs
1944
1944
1945
1945
def view_limits (self , dmin , dmax ):
1946
1946
if self ._symmetric :
@@ -2142,7 +2142,7 @@ def tick_values(self, vmin, vmax):
2142
2142
else :
2143
2143
ticklocs = b ** decades
2144
2144
2145
- return self . raise_if_exceeds ( np .asarray (ticklocs ) )
2145
+ return np .asarray (ticklocs )
2146
2146
2147
2147
def view_limits (self , vmin , vmax ):
2148
2148
'Try to choose the view limits intelligently'
@@ -2323,7 +2323,7 @@ def get_log_range(lo, hi):
2323
2323
else :
2324
2324
ticklocs = decades
2325
2325
2326
- return self . raise_if_exceeds ( np .array (ticklocs ) )
2326
+ return np .array (ticklocs )
2327
2327
2328
2328
def view_limits (self , vmin , vmax ):
2329
2329
'Try to choose the view limits intelligently'
@@ -2414,7 +2414,7 @@ def tick_values(self, vmin, vmax):
2414
2414
newticks = 1 - np .outer (np .arange (2 , 10 ), 10 ** expo ).ravel ()
2415
2415
ticklocs .extend (list (newticks ))
2416
2416
2417
- return self . raise_if_exceeds ( np .array (ticklocs ) )
2417
+ return np .array (ticklocs )
2418
2418
2419
2419
def nonsingular (self , vmin , vmax ):
2420
2420
initial_range = (1e-7 , 1 - 1e-7 )
@@ -2519,7 +2519,7 @@ def __call__(self):
2519
2519
else :
2520
2520
locs = []
2521
2521
2522
- return self . raise_if_exceeds ( np .array (locs ) )
2522
+ return np .array (locs )
2523
2523
2524
2524
def tick_values (self , vmin , vmax ):
2525
2525
raise NotImplementedError ('Cannot get tick locations for a '
@@ -2538,7 +2538,7 @@ def __init__(self):
2538
2538
def __call__ (self ):
2539
2539
'Return the locations of the ticks'
2540
2540
self .refresh ()
2541
- return self .raise_if_exceeds ( self . _locator () )
2541
+ return self ._locator ()
2542
2542
2543
2543
def tick_values (self , vmin , vmax ):
2544
2544
raise NotImplementedError ('Cannot get tick locations for a '
0 commit comments