@@ -1387,7 +1387,10 @@ class Locator(TickHelper):
1387
1387
# kill the machine when you try and render them.
1388
1388
# This parameter is set to cause locators to raise an error if too
1389
1389
# many ticks are generated.
1390
- MAXTICKS = 1000
1390
+ @property
1391
+ @cbook .deprecated ("2.1" )
1392
+ def MAXTICKS (self ):
1393
+ return 1000
1391
1394
1392
1395
def tick_values (self , vmin , vmax ):
1393
1396
"""
@@ -1420,6 +1423,7 @@ def __call__(self):
1420
1423
# hence there is no *one* interface to call self.tick_values.
1421
1424
raise NotImplementedError ('Derived must override' )
1422
1425
1426
+ @cbook .deprecated ("2.1" )
1423
1427
def raise_if_exceeds (self , locs ):
1424
1428
"""raise a RuntimeError if Locator attempts to create more than
1425
1429
MAXTICKS locs"""
@@ -1546,7 +1550,7 @@ def tick_values(self, vmin, vmax):
1546
1550
ticks1 = self .locs [i ::step ]
1547
1551
if np .abs (ticks1 ).min () < np .abs (ticks ).min ():
1548
1552
ticks = ticks1
1549
- return self . raise_if_exceeds ( ticks )
1553
+ return ticks
1550
1554
1551
1555
1552
1556
class NullLocator (Locator ):
@@ -1605,18 +1609,14 @@ def tick_values(self, vmin, vmax):
1605
1609
vmin , vmax = mtransforms .nonsingular (vmin , vmax , expander = 0.05 )
1606
1610
if vmax < vmin :
1607
1611
vmin , vmax = vmax , vmin
1608
-
1609
1612
if (vmin , vmax ) in self .presets :
1610
1613
return self .presets [(vmin , vmax )]
1611
-
1612
1614
if self .numticks is None :
1613
1615
self ._set_numticks ()
1614
-
1615
1616
if self .numticks == 0 :
1616
1617
return []
1617
1618
ticklocs = np .linspace (vmin , vmax , self .numticks )
1618
-
1619
- return self .raise_if_exceeds (ticklocs )
1619
+ return ticklocs
1620
1620
1621
1621
def _set_numticks (self ):
1622
1622
self .numticks = 11 # todo; be smart here; this is just for dev
@@ -1716,7 +1716,7 @@ def tick_values(self, vmin, vmax):
1716
1716
base = self ._base .get_base ()
1717
1717
n = (vmax - vmin + 0.001 * base ) // base
1718
1718
locs = vmin - base + np .arange (n + 3 ) * base
1719
- return self . raise_if_exceeds ( locs )
1719
+ return locs
1720
1720
1721
1721
def view_limits (self , dmin , dmax ):
1722
1722
"""
@@ -1931,7 +1931,7 @@ def tick_values(self, vmin, vmax):
1931
1931
locs = locs [:- 1 ]
1932
1932
elif prune == 'both' :
1933
1933
locs = locs [1 :- 1 ]
1934
- return self . raise_if_exceeds ( locs )
1934
+ return locs
1935
1935
1936
1936
def view_limits (self , dmin , dmax ):
1937
1937
if self ._symmetric :
@@ -2133,7 +2133,7 @@ def tick_values(self, vmin, vmax):
2133
2133
else :
2134
2134
ticklocs = b ** decades
2135
2135
2136
- return self . raise_if_exceeds ( np .asarray (ticklocs ) )
2136
+ return np .asarray (ticklocs )
2137
2137
2138
2138
def view_limits (self , vmin , vmax ):
2139
2139
'Try to choose the view limits intelligently'
@@ -2314,7 +2314,7 @@ def get_log_range(lo, hi):
2314
2314
else :
2315
2315
ticklocs = decades
2316
2316
2317
- return self . raise_if_exceeds ( np .array (ticklocs ) )
2317
+ return np .array (ticklocs )
2318
2318
2319
2319
def view_limits (self , vmin , vmax ):
2320
2320
'Try to choose the view limits intelligently'
@@ -2405,7 +2405,7 @@ def tick_values(self, vmin, vmax):
2405
2405
newticks = 1 - np .outer (np .arange (2 , 10 ), 10 ** expo ).ravel ()
2406
2406
ticklocs .extend (list (newticks ))
2407
2407
2408
- return self . raise_if_exceeds ( np .array (ticklocs ) )
2408
+ return np .array (ticklocs )
2409
2409
2410
2410
def nonsingular (self , vmin , vmax ):
2411
2411
initial_range = (1e-7 , 1 - 1e-7 )
@@ -2510,7 +2510,7 @@ def __call__(self):
2510
2510
else :
2511
2511
locs = []
2512
2512
2513
- return self . raise_if_exceeds ( np .array (locs ) )
2513
+ return np .array (locs )
2514
2514
2515
2515
def tick_values (self , vmin , vmax ):
2516
2516
raise NotImplementedError ('Cannot get tick locations for a '
@@ -2529,7 +2529,7 @@ def __init__(self):
2529
2529
def __call__ (self ):
2530
2530
'Return the locations of the ticks'
2531
2531
self .refresh ()
2532
- return self .raise_if_exceeds ( self . _locator () )
2532
+ return self ._locator ()
2533
2533
2534
2534
def tick_values (self , vmin , vmax ):
2535
2535
raise NotImplementedError ('Cannot get tick locations for a '
0 commit comments