class_docstr: A smoothed conditional mean
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  legend_fill_ratio : float, default=0.5
      How much (vertically) of the legend box should be filled by
      the color that indicates the confidence intervals. Should be
      in the range [0, 1].
class_docstr_tok: ["A","smoothed","conditional","mean","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","legend_fill_ratio",":","float",",","default=0.5","How","much","(","vertically",")","of","the","legend","box","should","be","filled","by","the","color","that","indicates","the","confidence","intervals",".","Should","be","in","the","range","[","0",",","1","]","."]
docstr: Draw letter 'a' in the box
  
  Parameters
  ----------
  data : dataframe
      Legend data
  da : DrawingArea
      Canvas
  lyr : layer
      Layer
  
  Returns
  -------
  out : DrawingArea
docstr_tok: ["Draw","letter","'","a","'","in","the","box","Parameters","--","--","--","--","--","data",":","dataframe","Legend","data","da",":","DrawingArea","Canvas","lyr",":","layer","Layer","Returns","--","--","--","-","out",":","DrawingArea"]
code: def draw_legend(
      data: pd.Series[Any], da: DrawingArea, lyr: Layer
  ) -> DrawingArea:
      """
      Draw letter 'a' in the box
  
      Parameters
      ----------
      data : dataframe
          Legend data
      da : DrawingArea
          Canvas
      lyr : layer
          Layer
  
      Returns
      -------
      out : DrawingArea
      """
      from matplotlib.patches import Rectangle
  
      try:
          has_se = lyr.stat.params["se"]
      except KeyError:
          has_se = False
  
      if has_se:
          fill = to_rgba(data["fill"], data["alpha"])
          r = lyr.geom.params["legend_fill_ratio"]
          bg = Rectangle(
              (0, (1 - r) * da.height / 2),
              width=da.width,
              height=r * da.height,
              facecolor=fill,
              linewidth=0,
          )
          da.add_artist(bg)
  
      data["alpha"] = 1
      return geom_path.draw_legend(data, da, lyr)
  
file_path: plotnine/plotnine/geoms/geom_smooth.py
imports: from __future__ import annotations
  import typing
  from .._utils import to_rgba
  from ..doctools import document
  from .geom import geom
  from .geom_line import geom_line, geom_path
  from .geom_ribbon import geom_ribbon
label_desc: Use image node_id 4 for calling the geom_smooth obj's underlying member method code with example usage: obj.draw_legend(data, da, lyr) and returns: geom_path