@@ -664,7 +664,6 @@ def __init__(self, axes, pickradius=15):
664
664
# Initialize here for testing; later add API
665
665
self ._major_tick_kw = dict ()
666
666
self ._minor_tick_kw = dict ()
667
- self ._tick_space = None
668
667
669
668
self .cla ()
670
669
self ._set_scale ('linear' )
@@ -796,7 +795,6 @@ def set_tick_params(self, which='major', reset=False, **kw):
796
795
for tick in self .minorTicks :
797
796
tick ._apply_params (** self ._minor_tick_kw )
798
797
self .stale = True
799
- self ._tick_space = None
800
798
801
799
@staticmethod
802
800
def _translate_tick_kw (kw , to_init_kw = True ):
@@ -1996,16 +1994,14 @@ def set_default_intervals(self):
1996
1994
self .stale = True
1997
1995
1998
1996
def get_tick_space (self ):
1999
- if self ._tick_space is None :
2000
- ends = self .axes .transAxes .transform ([[0 , 0 ], [1 , 0 ]])
2001
- length = ((ends [1 ][0 ] - ends [0 ][0 ]) / self .axes .figure .dpi ) * 72.0
2002
- tick = self ._get_tick (True )
2003
- # There is a heuristic here that the aspect ratio of tick text
2004
- # is no more than 3:1
2005
- size = tick .label1 .get_size () * 3
2006
- size *= np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2007
- return np .floor (length / size )
2008
- return self ._tick_space
1997
+ ends = self .axes .transAxes .transform ([[0 , 0 ], [1 , 0 ]])
1998
+ length = ((ends [1 ][0 ] - ends [0 ][0 ]) / self .axes .figure .dpi ) * 72.0
1999
+ tick = self ._get_tick (True )
2000
+ # There is a heuristic here that the aspect ratio of tick text
2001
+ # is no more than 3:1
2002
+ size = tick .label1 .get_size () * 3
2003
+ size *= np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2004
+ return np .floor (length / size )
2009
2005
2010
2006
2011
2007
class YAxis (Axis ):
@@ -2339,12 +2335,10 @@ def set_default_intervals(self):
2339
2335
self .stale = True
2340
2336
2341
2337
def get_tick_space (self ):
2342
- if self ._tick_space is None :
2343
- ends = self .axes .transAxes .transform ([[0 , 0 ], [0 , 1 ]])
2344
- length = ((ends [1 ][1 ] - ends [0 ][1 ]) / self .axes .figure .dpi ) * 72.0
2345
- tick = self ._get_tick (True )
2346
- # Having a spacing of at least 2 just looks good.
2347
- size = tick .label1 .get_size () * 2.0
2348
- size *= np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2349
- return np .floor (length / size )
2350
- return self ._tick_space
2338
+ ends = self .axes .transAxes .transform ([[0 , 0 ], [0 , 1 ]])
2339
+ length = ((ends [1 ][1 ] - ends [0 ][1 ]) / self .axes .figure .dpi ) * 72.0
2340
+ tick = self ._get_tick (True )
2341
+ # Having a spacing of at least 2 just looks good.
2342
+ size = tick .label1 .get_size () * 2.0
2343
+ size *= np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2344
+ return np .floor (length / size )
0 commit comments