code: def _get_study_figure(self, study_id, **kwargs):
      study = copy.deepcopy(self.studies[study_id])
      kind = study["kind"]
      display = study["display"]
      display["theme"] = display.get("theme", self.theme["theme"])
      params = study["params"]
      name = study["name"]
      params.update(include=False)
      local_kwargs = {}
      _slice = kwargs.pop("slice", self.data.get("slice", (None, None)))
      _resample = kwargs.pop(
          "resample", self.data.get("resample", None)
      )
  
      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)
  
      def get_params(locals_list, params, display, append_study=True):
          locals_list.append("legendgroup")
          local_kwargs = utils.check_kwargs(
              display, locals_list, {}, True
          )
          display.update(kwargs)
          if append_study:
              display = dict(
                  [("study_" + k, v) for k, v in display.items()]
              )
          params.update(display)
          return local_kwargs, params
  
      if kind == "volume":
          bar_colors = []
          local_kwargs, params = get_params([], params, display, False)
          # Fix for 152
          base_column = (
              params["base"] if params["colorchange"] else "volume"
          )
          base = df[self._d[base_column]]
          up_color = (
              colors.normalize(display["up_color"])
              if "rgba" not in display["up_color"]
              else display["up_color"]
          )
          down_color = (
              colors.normalize(display["down_color"])
              if "rgba" not in display["down_color"]
              else display["down_color"]
          )
          study_kwargs = utils.kwargs_from_keyword(kwargs, {}, "study")
  
          for i in range(len(base)):
              if i != 0:
                  if base[i] > base[i - 1]:
                      bar_colors.append(up_color)
                  else:
                      bar_colors.append(down_color)
              else:
                  bar_colors.append(down_color)
          fig = df[params["column"]].figure(
              kind="bar", theme=params["theme"], **kwargs
          )
          fig["data"][0].update(
              marker=dict(
                  color=bar_colors, line=dict(color=bar_colors)
              ),
              opacity=0.8,
          )
  
      if kind in ("sma", "ema", "atr", "adx", "dmi", "ptps"):
          local_kwargs, params = get_params([], params, display)
          fig = df.ta_figure(study=kind, **params)
  
      if kind == "boll":
          local_kwargs, params = get_params(
              ["fill", "fillcolor"], params, display
          )
          fig = df.ta_figure(study=kind, **params)
          if local_kwargs["fill"]:
              fillcolor = local_kwargs.pop(
                  "fillcolor",
                  fig["data"][2]["line"]["color"]
                  or "rgba(200,200,200,.1)",
              )
              fillcolor = colors.to_rgba(fillcolor, 0.1)
              fig["data"][2].update(fill="tonexty", fillcolor=fillcolor)
  
      if kind == "rsi":
          locals_list = ["rsi_lower", "rsi_upper", "showbands"]
          local_kwargs, params = get_params(
              locals_list, params, display
          )
          fig = df.ta_figure(study=kind, **params)
          # del fig.layout['shapes']
          # if local_kwargs['showbands']:
          # 	up_color=kwargs.get('up_color',self.theme['up_color'])
          # 	down_color=kwargs.get('down_color',self.theme['down_color'])
          # 	for _ in ('rsi_lower','rsi_upper'):
          # 		trace=fig.data[0].copy()
          # 		trace.update(y=[local_kwargs[_] for x in trace['x']])
          # 		trace.update(name='')
          # 		color=down_color if 'lower' in _ else up_color
          # 		trace.update(line=dict(color=color,width=1))
          # 		fig.data.append(trace)
  
      if kind == "cci":
          locals_list = ["cci_lower", "cci_upper", "showbands"]
          local_kwargs, params = get_params(
              locals_list, params, display
          )
          fig = df.ta_figure(study=kind, **params)
          # del fig.layout['shapes']
          # if local_kwargs['showbands']:
          # 	up_color=kwargs.get('up_color',self.theme['up_color'])
          # 	down_color=kwargs.get('down_color',self.theme['down_color'])
          # 	for _ in ('cci_lower','cci_upper'):
          # 		trace=fig.data[0].copy()
          # 		trace.update(y=[local_kwargs[_] for x in trace['x']])
          # 		trace.update(name='')
          # 		color=down_color if 'lower' in _ else up_color
          # 		trace.update(line=dict(color=color,width=1))
          # 		fig.data.append(trace)
  
      if kind == "macd":
          local_kwargs, params = get_params([], params, display)
          fig = df.ta_figure(study=kind, **params)
  
      if local_kwargs.get("legendgroup", False):
          for trace in fig["data"]:
              trace["legendgroup"] = name
              trace["showlegend"] = False
          fig["data"][0].update(showlegend=True, name=name)
  
      ## Has Bands
      if kind in ("rsi", "cci"):
          fig = tools.fig_to_dict(fig)
          _upper = "{0}_upper".format(kind)
          _lower = "{0}_lower".format(kind)
          del fig["layout"]["shapes"]
          if local_kwargs["showbands"]:
              up_color = kwargs.get("up_color", self.theme["up_color"])
              down_color = kwargs.get(
                  "down_color", self.theme["down_color"]
              )
              for _ in (_lower, _upper):
                  trace = copy.deepcopy(fig["data"][0])
                  trace.update(y=[local_kwargs[_] for x in trace["x"]])
                  trace.update(name="")
                  color = down_color if "lower" in _ else up_color
                  trace.update(line=dict(color=color, width=1))
                  fig["data"].append(trace)
  
      return fig
  
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 27 for calling the QuantFig obj's underlying member method code with example usage: obj._get_study_figure(study_id) and returns: fig, local_kwargs,  params