code: def iplot(self, **kwargs):
      __QUANT_FIGURE_EXPORT = [
          "asFigure",
          "asUrl",
          "asImage",
          "asPlot",
          "display_image",
          "validate",
          "sharing",
          "online",
          "filename",
          "dimensions",
      ]
  
      layout = copy.deepcopy(self.layout)
      data = copy.deepcopy(self.data)
      self_kwargs = copy.deepcopy(self.kwargs)
  
      data["slice"] = kwargs.pop(
          "slice", data.pop("slice", (None, None))
      )
      data["resample"] = kwargs.pop(
          "resample", data.pop("resample", None)
      )
  
      asFigure = kwargs.pop("asFigure", False)
      showstudies = kwargs.pop("showstudies", True)
      study_kwargs = utils.kwargs_from_keyword(
          kwargs, {}, "study", True
      )
      datalegend = kwargs.pop(
          "datalegend",
          data.pop("datalegend", data.pop("showlegend", True)),
      )
      export_kwargs = utils.check_kwargs(kwargs, __QUANT_FIGURE_EXPORT)
  
      _slice = data.pop("slice")
      _resample = data.pop("resample")
  
      panel_data = {}
      for k in [
          "min_panel_size",
          "spacing",
          "top_margin",
          "bottom_margin",
      ]:
          panel_data[k] = kwargs.pop(k, self.panels[k])
  
      d = self_kwargs
      df = self._get_sliced(_slice).copy()
      if _resample:
          if utils.is_list(_resample):
              df = self._get_resampled(*_resample, df=df)
          elif utils.is_dict(_resample):
              _resample.update(df=df)
              df = self._get_resampled(**_resample)
          else:
              df = self._get_resampled(_resample, df=df)
  
      annotations = layout.pop("annotations")
      shapes = layout.pop("shapes")
      if not "shapes" in shapes:
          shapes["shapes"] = []
      for trend in self.trendlines:
          _trend = self._get_trendline(**trend)
          shapes["shapes"].append(_trend["shape"])
          if "text" in _trend["annotation"]:
              annotations["values"].append(_trend["annotation"])
      shape_kwargs = utils.check_kwargs(
          kwargs, get_shapes_kwargs(), {}, clean_origin=True
      )
      for k, v in list(shape_kwargs.items()):
          if k in shapes:
              if isinstance(v, list):
                  shapes[k].extend(v)
              else:
                  shapes[k].append(v)
          else:
              shapes[k] = [v]
      for _ in [
          data,
          layout,
          self._d,
          self.theme,
          {"annotations": annotations["values"]},
          annotations["params"],
          shapes,
      ]:
          if _:
              d = utils.merge_dict(d, _)
      d = utils.deep_update(d, kwargs)
      d = tools.updateColors(d)
      fig = df.figure(**d)
  
      if d["kind"] not in ("candle", "candlestick", "ohlc"):
          tools._move_axis(fig, yaxis="y2")  # FIXME TKP
          pass
      else:
          if not datalegend:
              fig["data"][0]["decreasing"].update(showlegend=False)
              fig["data"][0]["increasing"].update(showlegend=False)
  
      ## 126 Shapes in wrong axis
      for shape in fig["layout"]["shapes"]:
          if "yref" in shape:
              if len(shape["yref"]) == 1:  # not an explicity yref
                  shape.update(yref="y2")
  
      panel_data["n"] = 1
  
      which = [x["yaxis"] for x in fig["data"]]
      which.sort()
      max_panel = int(which[-1][1:])
      figures = []
  
      if showstudies:
          kwargs = utils.check_kwargs(
              kwargs, ["theme", "up_color", "down_color"], {}, False
          )
          kwargs.update(**study_kwargs)
          kwargs.update(slice=_slice, resample=_resample)
          for k, v in list(self.studies.items()):
              study_fig = self._get_study_figure(k, **kwargs)
              study_fig = tools.fig_to_dict(study_fig)
              if "yaxis" in study_fig["layout"]:
                  study_fig["layout"]["yaxis1"] = study_fig["layout"][
                      "yaxis"
                  ].copy()
                  del study_fig["layout"]["yaxis"]
              if v["kind"] in ("boll", "sma", "ema", "ptps"):
                  tools._move_axis(study_fig, yaxis="y2")  # FIXME TKP
                  pass
              if v["kind"] in (
                  "rsi",
                  "volume",
                  "macd",
                  "atr",
                  "adx",
                  "cci",
                  "dmi",
              ):
                  max_panel += 1
                  panel_data["n"] += 1
                  tools._move_axis(
                      study_fig, yaxis="y{0}".format(max_panel)
                  )  # FIXME TKP
              figures.append(study_fig)
          figures.append(fig)
          fig = tools.merge_figures(figures)
  
          try:
              fig["layout"]["xaxis1"]["anchor"] = "y2"
          except:
              fig["layout"]["xaxis"]["anchor"] = "y2"
  
      domains = self._panel_domains(**panel_data)
      try:
          for k, v in list(domains.items()):
              fig["layout"][k].update(v)
      except:
          fig["layout"].update(**domains)
      if not d.get("rangeslider", False):
          try:
              del fig["layout"]["yaxis1"]
          except:
              pass
      if asFigure:
          return go.Figure(fig)
      else:
          return pt_iplot(fig, **export_kwargs)
  
imports: from __future__ import absolute_import
  import plotly.graph_objs
  import json
  import copy
  import pandas
  from .plotlytools import iplot
  from .None import tools
  from .None import ta
  from .None import utils
  from .None import colors
  from .None import auth
  from .None import date_tools
label_desc: Use image node_id 28 for calling the QuantFig obj's underlying member method code with example usage: obj.iplot() and returns: go, pt_iplot