parameters: (self, dmin, dmax)
return_statement: return dates.AutoDateLocator.get_locator(self, dmin, dmax)
docstring: Pick the best locator based on a distance.
docstring_summary: Pick the best locator based on a distance.
docstring_tokens: Pick the best locator based on a distance .
function: def get_locator(self, dmin, dmax):
          """Pick the best locator based on a distance."""
          delta = relativedelta(dmax, dmin)
  
          num_days = (delta.years * 12.0 + delta.months) * 31.0 + delta.days
          num_sec = (delta.hours * 60.0 + delta.minutes) * 60.0 + delta.seconds
          tot_sec = num_days * 86400.0 + num_sec
  
          if abs(tot_sec) < self.minticks:
              self._freq = -1
              locator = MilliSecondLocator(self.tz)
              locator.set_axis(self.axis)
  
              locator.set_view_interval(*self.axis.get_view_interval())
              locator.set_data_interval(*self.axis.get_data_interval())
              return locator
  
          return dates.AutoDateLocator.get_locator(self, dmin, dmax)
function_tokens: def get_locator ( self , dmin , dmax ) : delta = relativedelta ( dmax , dmin ) num_days = ( delta . years * 12.0 + delta . months ) * 31.0 + delta . days num_sec = ( delta . hours * 60.0 + delta . minutes ) * 60.0 + delta . seconds tot_sec = num_days * 86400.0 + num_sec if abs ( tot_sec ) < self . minticks : self . _freq = - 1 locator = MilliSecondLocator ( self . tz ) locator . set_axis ( self . axis ) locator . set_view_interval ( * self . axis . get_view_interval ( ) ) locator . set_data_interval ( * self . axis . get_data_interval ( ) ) return locator return dates . AutoDateLocator . get_locator ( self , dmin , dmax )