@@ -664,7 +664,6 @@ def __init__(self, axes, pickradius=15):
664664        # Initialize here for testing; later add API 
665665        self ._major_tick_kw  =  dict ()
666666        self ._minor_tick_kw  =  dict ()
667-         self ._tick_space  =  None 
668667
669668        self .cla ()
670669        self ._set_scale ('linear' )
@@ -796,7 +795,6 @@ def set_tick_params(self, which='major', reset=False, **kw):
796795                for  tick  in  self .minorTicks :
797796                    tick ._apply_params (** self ._minor_tick_kw )
798797        self .stale  =  True 
799-         self ._tick_space  =  None 
800798
801799    @staticmethod  
802800    def  _translate_tick_kw (kw , to_init_kw = True ):
@@ -2018,16 +2016,14 @@ def set_default_intervals(self):
20182016        self .stale  =  True 
20192017
20202018    def  get_tick_space (self ):
2021-         if  self ._tick_space  is  None :
2022-             ends  =  self .axes .transAxes .transform ([[0 , 0 ], [1 , 0 ]])
2023-             length  =  ((ends [1 ][0 ] -  ends [0 ][0 ]) /  self .axes .figure .dpi ) *  72.0 
2024-             tick  =  self ._get_tick (True )
2025-             # There is a heuristic here that the aspect ratio of tick text 
2026-             # is no more than 3:1 
2027-             size  =  tick .label1 .get_size () *  3 
2028-             size  *=  np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2029-             self ._tick_space  =  np .floor (length  /  size )
2030-         return  self ._tick_space 
2019+         ends  =  self .axes .transAxes .transform ([[0 , 0 ], [1 , 0 ]])
2020+         length  =  ((ends [1 ][0 ] -  ends [0 ][0 ]) /  self .axes .figure .dpi ) *  72.0 
2021+         tick  =  self ._get_tick (True )
2022+         # There is a heuristic here that the aspect ratio of tick text 
2023+         # is no more than 3:1 
2024+         size  =  tick .label1 .get_size () *  3 
2025+         size  *=  np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2026+         return  np .floor (length  /  size )
20312027
20322028
20332029class  YAxis (Axis ):
@@ -2361,12 +2357,10 @@ def set_default_intervals(self):
23612357        self .stale  =  True 
23622358
23632359    def  get_tick_space (self ):
2364-         if  self ._tick_space  is  None :
2365-             ends  =  self .axes .transAxes .transform ([[0 , 0 ], [0 , 1 ]])
2366-             length  =  ((ends [1 ][1 ] -  ends [0 ][1 ]) /  self .axes .figure .dpi ) *  72.0 
2367-             tick  =  self ._get_tick (True )
2368-             # Having a spacing of at least 2 just looks good. 
2369-             size  =  tick .label1 .get_size () *  2.0 
2370-             size  *=  np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2371-             self ._tick_space  =  np .floor (length  /  size )
2372-         return  self ._tick_space 
2360+         ends  =  self .axes .transAxes .transform ([[0 , 0 ], [0 , 1 ]])
2361+         length  =  ((ends [1 ][1 ] -  ends [0 ][1 ]) /  self .axes .figure .dpi ) *  72.0 
2362+         tick  =  self ._get_tick (True )
2363+         # Having a spacing of at least 2 just looks good. 
2364+         size  =  tick .label1 .get_size () *  2.0 
2365+         size  *=  np .cos (np .deg2rad (tick .label1 .get_rotation ()))
2366+         return  np .floor (length  /  size )
0 commit comments