@@ -1422,7 +1422,10 @@ class Locator(TickHelper):
14221422 # kill the machine when you try and render them.
14231423 # This parameter is set to cause locators to raise an error if too
14241424 # many ticks are generated.
1425- MAXTICKS = 1000
1425+ @property
1426+ @cbook .deprecated ("2.1" )
1427+ def MAXTICKS (self ):
1428+ return 1000
14261429
14271430 def tick_values (self , vmin , vmax ):
14281431 """
@@ -1455,6 +1458,7 @@ def __call__(self):
14551458 # hence there is no *one* interface to call self.tick_values.
14561459 raise NotImplementedError ('Derived must override' )
14571460
1461+ @cbook .deprecated ("2.1" )
14581462 def raise_if_exceeds (self , locs ):
14591463 """raise a RuntimeError if Locator attempts to create more than
14601464 MAXTICKS locs"""
@@ -1581,7 +1585,7 @@ def tick_values(self, vmin, vmax):
15811585 ticks1 = self .locs [i ::step ]
15821586 if np .abs (ticks1 ).min () < np .abs (ticks ).min ():
15831587 ticks = ticks1
1584- return self . raise_if_exceeds ( ticks )
1588+ return ticks
15851589
15861590
15871591class NullLocator (Locator ):
@@ -1640,18 +1644,14 @@ def tick_values(self, vmin, vmax):
16401644 vmin , vmax = mtransforms .nonsingular (vmin , vmax , expander = 0.05 )
16411645 if vmax < vmin :
16421646 vmin , vmax = vmax , vmin
1643-
16441647 if (vmin , vmax ) in self .presets :
16451648 return self .presets [(vmin , vmax )]
1646-
16471649 if self .numticks is None :
16481650 self ._set_numticks ()
1649-
16501651 if self .numticks == 0 :
16511652 return []
16521653 ticklocs = np .linspace (vmin , vmax , self .numticks )
1653-
1654- return self .raise_if_exceeds (ticklocs )
1654+ return ticklocs
16551655
16561656 def _set_numticks (self ):
16571657 self .numticks = 11 # todo; be smart here; this is just for dev
@@ -1751,7 +1751,7 @@ def tick_values(self, vmin, vmax):
17511751 base = self ._base .get_base ()
17521752 n = (vmax - vmin + 0.001 * base ) // base
17531753 locs = vmin - base + np .arange (n + 3 ) * base
1754- return self . raise_if_exceeds ( locs )
1754+ return locs
17551755
17561756 def view_limits (self , dmin , dmax ):
17571757 """
@@ -1966,7 +1966,7 @@ def tick_values(self, vmin, vmax):
19661966 locs = locs [:- 1 ]
19671967 elif prune == 'both' :
19681968 locs = locs [1 :- 1 ]
1969- return self . raise_if_exceeds ( locs )
1969+ return locs
19701970
19711971 def view_limits (self , dmin , dmax ):
19721972 if self ._symmetric :
@@ -2174,7 +2174,7 @@ def tick_values(self, vmin, vmax):
21742174 else :
21752175 ticklocs = b ** decades
21762176
2177- return self . raise_if_exceeds ( np .asarray (ticklocs ) )
2177+ return np .asarray (ticklocs )
21782178
21792179 def view_limits (self , vmin , vmax ):
21802180 'Try to choose the view limits intelligently'
@@ -2355,7 +2355,7 @@ def get_log_range(lo, hi):
23552355 else :
23562356 ticklocs = decades
23572357
2358- return self . raise_if_exceeds ( np .array (ticklocs ) )
2358+ return np .array (ticklocs )
23592359
23602360 def view_limits (self , vmin , vmax ):
23612361 'Try to choose the view limits intelligently'
@@ -2446,7 +2446,7 @@ def tick_values(self, vmin, vmax):
24462446 newticks = 1 - np .outer (np .arange (2 , 10 ), 10 ** expo ).ravel ()
24472447 ticklocs .extend (list (newticks ))
24482448
2449- return self . raise_if_exceeds ( np .array (ticklocs ) )
2449+ return np .array (ticklocs )
24502450
24512451 def nonsingular (self , vmin , vmax ):
24522452 initial_range = (1e-7 , 1 - 1e-7 )
@@ -2553,7 +2553,7 @@ def __call__(self):
25532553 cond = np .abs ((locs - t0 ) % majorstep ) > minorstep / 10.0
25542554 locs = locs .compress (cond )
25552555
2556- return self . raise_if_exceeds ( np .array (locs ) )
2556+ return np .array (locs )
25572557
25582558 def tick_values (self , vmin , vmax ):
25592559 raise NotImplementedError ('Cannot get tick locations for a '
@@ -2572,7 +2572,7 @@ def __init__(self):
25722572 def __call__ (self ):
25732573 'Return the locations of the ticks'
25742574 self .refresh ()
2575- return self .raise_if_exceeds ( self . _locator () )
2575+ return self ._locator ()
25762576
25772577 def tick_values (self , vmin , vmax ):
25782578 raise NotImplementedError ('Cannot get tick locations for a '
0 commit comments