code: def setlocators(self, ax):
      clock = sorted(
          self.pinf.clock.datas,
          key=lambda x: (x._timeframe, x._compression),
      )[0]
  
      comp = getattr(clock, "_compression", 1)
      tframe = getattr(clock, "_timeframe", TimeFrame.Days)
  
      if self.pinf.sch.fmt_x_data is None:
          if tframe == TimeFrame.Years:
              fmtdata = "%Y"
          elif tframe == TimeFrame.Months:
              fmtdata = "%Y-%m"
          elif tframe == TimeFrame.Weeks:
              fmtdata = "%Y-%m-%d"
          elif tframe == TimeFrame.Days:
              fmtdata = "%Y-%m-%d"
          elif tframe == TimeFrame.Minutes:
              fmtdata = "%Y-%m-%d %H:%M"
          elif tframe == TimeFrame.Seconds:
              fmtdata = "%Y-%m-%d %H:%M:%S"
          elif tframe == TimeFrame.MicroSeconds:
              fmtdata = "%Y-%m-%d %H:%M:%S.%f"
          elif tframe == TimeFrame.Ticks:
              fmtdata = "%Y-%m-%d %H:%M:%S.%f"
      else:
          fmtdata = self.pinf.sch.fmt_x_data
  
      fordata = MyDateFormatter(self.pinf.xreal, fmt=fmtdata)
      for dax in self.pinf.daxis.values():
          dax.fmt_xdata = fordata
  
      # Major locator / formatter
      locmajor = loc.AutoDateLocator(self.pinf.xreal)
      ax.xaxis.set_major_locator(locmajor)
      if self.pinf.sch.fmt_x_ticks is None:
          autofmt = loc.AutoDateFormatter(self.pinf.xreal, locmajor)
      else:
          autofmt = MyDateFormatter(
              self.pinf.xreal, fmt=self.pinf.sch.fmt_x_ticks
          )
      ax.xaxis.set_major_formatter(autofmt)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import bisect
  import collections
  import datetime
  import itertools
  import math
  import operator
  import sys
  import matplotlib
  import numpy
  import matplotlib.dates
  import matplotlib.font_manager
  import matplotlib.legend
  import matplotlib.ticker
  from ..utils.py3 import range, with_metaclass, string_types, integer_types
  from ..None import AutoInfoClass, MetaParams, TimeFrame, date2num
  from .finance import plot_candlestick, plot_ohlc, plot_volume, plot_lineonclose
  from .formatters import MyVolFormatter, MyDateFormatter, getlocator
  from .None import locator
  from .multicursor import MultiCursor
  from .scheme import PlotScheme
  from .utils import tag_box_style
label_desc: Use image node_id 4 for calling the Plot_OldSync obj's underlying member method code with example usage: obj.setlocators(ax) without return types