@@ -1387,7 +1387,10 @@ class Locator(TickHelper):
13871387 # kill the machine when you try and render them.
13881388 # This parameter is set to cause locators to raise an error if too
13891389 # many ticks are generated.
1390- MAXTICKS = 1000
1390+ @property
1391+ @cbook .deprecated ("2.1" )
1392+ def MAXTICKS (self ):
1393+ return 1000
13911394
13921395 def tick_values (self , vmin , vmax ):
13931396 """
@@ -1420,6 +1423,7 @@ def __call__(self):
14201423 # hence there is no *one* interface to call self.tick_values.
14211424 raise NotImplementedError ('Derived must override' )
14221425
1426+ @cbook .deprecated ("2.1" )
14231427 def raise_if_exceeds (self , locs ):
14241428 """raise a RuntimeError if Locator attempts to create more than
14251429 MAXTICKS locs"""
@@ -1546,7 +1550,7 @@ def tick_values(self, vmin, vmax):
15461550 ticks1 = self .locs [i ::step ]
15471551 if np .abs (ticks1 ).min () < np .abs (ticks ).min ():
15481552 ticks = ticks1
1549- return self . raise_if_exceeds ( ticks )
1553+ return ticks
15501554
15511555
15521556class NullLocator (Locator ):
@@ -1605,18 +1609,14 @@ def tick_values(self, vmin, vmax):
16051609 vmin , vmax = mtransforms .nonsingular (vmin , vmax , expander = 0.05 )
16061610 if vmax < vmin :
16071611 vmin , vmax = vmax , vmin
1608-
16091612 if (vmin , vmax ) in self .presets :
16101613 return self .presets [(vmin , vmax )]
1611-
16121614 if self .numticks is None :
16131615 self ._set_numticks ()
1614-
16151616 if self .numticks == 0 :
16161617 return []
16171618 ticklocs = np .linspace (vmin , vmax , self .numticks )
1618-
1619- return self .raise_if_exceeds (ticklocs )
1619+ return ticklocs
16201620
16211621 def _set_numticks (self ):
16221622 self .numticks = 11 # todo; be smart here; this is just for dev
@@ -1716,7 +1716,7 @@ def tick_values(self, vmin, vmax):
17161716 base = self ._base .get_base ()
17171717 n = (vmax - vmin + 0.001 * base ) // base
17181718 locs = vmin - base + np .arange (n + 3 ) * base
1719- return self . raise_if_exceeds ( locs )
1719+ return locs
17201720
17211721 def view_limits (self , dmin , dmax ):
17221722 """
@@ -1931,7 +1931,7 @@ def tick_values(self, vmin, vmax):
19311931 locs = locs [:- 1 ]
19321932 elif prune == 'both' :
19331933 locs = locs [1 :- 1 ]
1934- return self . raise_if_exceeds ( locs )
1934+ return locs
19351935
19361936 def view_limits (self , dmin , dmax ):
19371937 if self ._symmetric :
@@ -2133,7 +2133,7 @@ def tick_values(self, vmin, vmax):
21332133 else :
21342134 ticklocs = b ** decades
21352135
2136- return self . raise_if_exceeds ( np .asarray (ticklocs ) )
2136+ return np .asarray (ticklocs )
21372137
21382138 def view_limits (self , vmin , vmax ):
21392139 'Try to choose the view limits intelligently'
@@ -2314,7 +2314,7 @@ def get_log_range(lo, hi):
23142314 else :
23152315 ticklocs = decades
23162316
2317- return self . raise_if_exceeds ( np .array (ticklocs ) )
2317+ return np .array (ticklocs )
23182318
23192319 def view_limits (self , vmin , vmax ):
23202320 'Try to choose the view limits intelligently'
@@ -2405,7 +2405,7 @@ def tick_values(self, vmin, vmax):
24052405 newticks = 1 - np .outer (np .arange (2 , 10 ), 10 ** expo ).ravel ()
24062406 ticklocs .extend (list (newticks ))
24072407
2408- return self . raise_if_exceeds ( np .array (ticklocs ) )
2408+ return np .array (ticklocs )
24092409
24102410 def nonsingular (self , vmin , vmax ):
24112411 initial_range = (1e-7 , 1 - 1e-7 )
@@ -2510,7 +2510,7 @@ def __call__(self):
25102510 else :
25112511 locs = []
25122512
2513- return self . raise_if_exceeds ( np .array (locs ) )
2513+ return np .array (locs )
25142514
25152515 def tick_values (self , vmin , vmax ):
25162516 raise NotImplementedError ('Cannot get tick locations for a '
@@ -2529,7 +2529,7 @@ def __init__(self):
25292529 def __call__ (self ):
25302530 'Return the locations of the ticks'
25312531 self .refresh ()
2532- return self .raise_if_exceeds ( self . _locator () )
2532+ return self ._locator ()
25332533
25342534 def tick_values (self , vmin , vmax ):
25352535 raise NotImplementedError ('Cannot get tick locations for a '
0 commit comments