code: def plotdata(self, data, indicators):
      for ind in indicators:
          upinds = self.dplotsup[ind]
          for upind in upinds:
              self.plotind(
                  data,
                  upind,
                  subinds=self.dplotsover[upind],
                  upinds=self.dplotsup[upind],
                  downinds=self.dplotsdown[upind],
              )
  
      opens = data.open.plotrange(self.pinf.xstart, self.pinf.xend)
      highs = data.high.plotrange(self.pinf.xstart, self.pinf.xend)
      lows = data.low.plotrange(self.pinf.xstart, self.pinf.xend)
      closes = data.close.plotrange(self.pinf.xstart, self.pinf.xend)
      volumes = data.volume.plotrange(self.pinf.xstart, self.pinf.xend)
  
      vollabel = "Volume"
      pmaster = data.plotinfo.plotmaster
      if pmaster is data:
          pmaster = None
  
      datalabel = ""
      if hasattr(data, "_name") and data._name:
          datalabel += data._name
  
      voloverlay = self.pinf.sch.voloverlay and pmaster is None
  
      if not voloverlay:
          vollabel += " ({})".format(datalabel)
  
      # if self.pinf.sch.volume and self.pinf.sch.voloverlay:
      axdatamaster = None
      if self.pinf.sch.volume and voloverlay:
          volplot = self.plotvolume(
              data, opens, highs, lows, closes, volumes, vollabel
          )
          axvol = self.pinf.daxis[data.volume]
          ax = axvol.twinx()
          self.pinf.daxis[data] = ax
          self.pinf.vaxis.append(ax)
      else:
          if pmaster is None:
              ax = self.newaxis(data, rowspan=self.pinf.sch.rowsmajor)
          elif getattr(data.plotinfo, "sameaxis", False):
              axdatamaster = self.pinf.daxis[pmaster]
              ax = axdatamaster
          else:
              axdatamaster = self.pinf.daxis[pmaster]
              ax = axdatamaster.twinx()
              self.pinf.vaxis.append(ax)
  
      if hasattr(data, "_compression") and hasattr(data, "_timeframe"):
          tfname = TimeFrame.getname(data._timeframe, data._compression)
          datalabel += " (%d %s)" % (data._compression, tfname)
  
      plinevalues = getattr(data.plotinfo, "plotlinevalues", True)
      if self.pinf.sch.style.startswith("line"):
          if self.pinf.sch.linevalues and plinevalues:
              datalabel += " C:%.2f" % closes[-1]
  
          if axdatamaster is None:
              color = self.pinf.sch.loc
          else:
              self.pinf.nextcolor(axdatamaster)
              color = self.pinf.color(axdatamaster)
  
          plotted = plot_lineonclose(
              ax, self.pinf.xdata, closes, color=color, label=datalabel
          )
      else:
          if self.pinf.sch.linevalues and plinevalues:
              datalabel += " O:%.2f H:%.2f L:%.2f C:%.2f" % (
                  opens[-1],
                  highs[-1],
                  lows[-1],
                  closes[-1],
              )
          if self.pinf.sch.style.startswith("candle"):
              plotted = plot_candlestick(
                  ax,
                  self.pinf.xdata,
                  opens,
                  highs,
                  lows,
                  closes,
                  colorup=self.pinf.sch.barup,
                  colordown=self.pinf.sch.bardown,
                  label=datalabel,
                  alpha=self.pinf.sch.baralpha,
                  fillup=self.pinf.sch.barupfill,
                  filldown=self.pinf.sch.bardownfill,
              )
  
          elif self.pinf.sch.style.startswith("bar") or True:
              # final default option -- should be "else"
              plotted = plot_ohlc(
                  ax,
                  self.pinf.xdata,
                  opens,
                  highs,
                  lows,
                  closes,
                  colorup=self.pinf.sch.barup,
                  colordown=self.pinf.sch.bardown,
                  label=datalabel,
              )
  
      self.pinf.zorder[ax] = plotted[0].get_zorder()
  
      # Code to place a label at the right hand side with the last value
      vtags = data.plotinfo._get("plotvaluetags", True)
      if self.pinf.sch.valuetags and vtags:
          self.drawtag(
              ax,
              len(self.pinf.xreal),
              closes[-1],
              facecolor=self.pinf.sch.locbg,
              edgecolor=self.pinf.sch.loc,
          )
  
      ax.yaxis.set_major_locator(mticker.MaxNLocator(prune="both"))
      # make sure "over" indicators do not change our scale
      if data.plotinfo._get("plotylimited", True):
          if axdatamaster is None:
              ax.set_ylim(ax.get_ylim())
  
      if self.pinf.sch.volume:
          # if not self.pinf.sch.voloverlay:
          if not voloverlay:
              self.plotvolume(
                  data, opens, highs, lows, closes, volumes, vollabel
              )
          else:
              # Prepare overlay scaling/pushup or manage own axis
              if self.pinf.sch.volpushup:
                  # push up overlaid axis by lowering the bottom limit
                  axbot, axtop = ax.get_ylim()
                  axbot *= 1.0 - self.pinf.sch.volpushup
                  ax.set_ylim(axbot, axtop)
  
      for ind in indicators:
          self.plotind(
              data, ind, subinds=self.dplotsover[ind], masterax=ax
          )
  
      handles, labels = ax.get_legend_handles_labels()
      a = axdatamaster or ax
      if handles:
          # put data and volume legend entries in the 1st positions
          # because they are "collections" they are considered after Line2D
          # for the legend entries, which is not our desire
          # if self.pinf.sch.volume and self.pinf.sch.voloverlay:
  
          ai = self.pinf.legpos[a]
          if self.pinf.sch.volume and voloverlay:
              if volplot:
                  # even if volume plot was requested, there may be no volume
                  labels.insert(ai, vollabel)
                  handles.insert(ai, volplot)
  
          didx = labels.index(datalabel)
          labels.insert(ai, labels.pop(didx))
          handles.insert(ai, handles.pop(didx))
  
          if axdatamaster is None:
              self.pinf.handles[ax] = handles
              self.pinf.labels[ax] = labels
          else:
              self.pinf.handles[axdatamaster] = handles
              self.pinf.labels[axdatamaster] = labels
              # self.pinf.handles[axdatamaster].extend(handles)
              # self.pinf.labels[axdatamaster].extend(labels)
  
          h = self.pinf.handles[a]
          l = self.pinf.labels[a]
  
          axlegend = a
          loc = data.plotinfo.legendloc or self.pinf.sch.legenddataloc
          legend = axlegend.legend(
              h,
              l,
              loc=loc,
              frameon=False,
              shadow=False,
              fancybox=False,
              prop=self.pinf.prop,
              numpoints=1,
              ncol=1,
          )
  
          # hack: if title is set. legend has a Vbox for the labels
          # which has a default "center" set
          legend._legend_box.align = "left"
  
      for ind in indicators:
          downinds = self.dplotsdown[ind]
          for downind in downinds:
              self.plotind(
                  data,
                  downind,
                  subinds=self.dplotsover[downind],
                  upinds=self.dplotsup[downind],
                  downinds=self.dplotsdown[downind],
              )
  
      self.pinf.legpos[a] = len(self.pinf.handles[a])
  
      if data.plotinfo._get("plotlog", False):
          a = axdatamaster or ax
          a.set_yscale("log")
  
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 9 for calling the Plot_OldSync obj's underlying member method code with example usage: obj.plotdata(data, indicators) without return types