class_docstr: Polygon, a filled path
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  
  Notes
  -----
  All paths in the same `group` aesthetic value make up a polygon.
class_docstr_tok: ["Polygon",",","a","filled","path","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","Notes","--","--","-","All","paths","in","the","same","`","group","`","aesthetic","value","make","up","a","polygon","."]
docstr: Draw a rectangle in the box
  
  Parameters
  ----------
  data : Series
      Data Row
  da : DrawingArea
      Canvas
  lyr : layer
      Layer
  
  Returns
  -------
  out : DrawingArea
docstr_tok: ["Draw","a","rectangle","in","the","box","Parameters","--","--","--","--","--","data",":","Series","Data","Row","da",":","DrawingArea","Canvas","lyr",":","layer","Layer","Returns","--","--","--","-","out",":","DrawingArea"]
code: def draw_legend(
      data: pd.Series[Any], da: DrawingArea, lyr: Layer
  ) -> DrawingArea:
      """
      Draw a rectangle in the box
  
      Parameters
      ----------
      data : Series
          Data Row
      da : DrawingArea
          Canvas
      lyr : layer
          Layer
  
      Returns
      -------
      out : DrawingArea
      """
      from matplotlib.patches import Rectangle
  
      data["size"] *= SIZE_FACTOR
      # We take into account that the linewidth
      # bestrides the boundary of the rectangle
      linewidth = np.min([data["size"], da.width / 4, da.height / 4])
  
      if data["color"] is None:
          linewidth = 0
  
      facecolor = to_rgba(data["fill"], data["alpha"])
      if facecolor is None:
          facecolor = "none"
  
      rect = Rectangle(
          (0 + linewidth / 2, 0 + linewidth / 2),
          width=da.width - linewidth,
          height=da.height - linewidth,
          linewidth=linewidth,
          linestyle=data["linetype"],
          facecolor=facecolor,
          edgecolor=data["color"],
          capstyle="projecting",
      )
      da.add_artist(rect)
      return da
  
file_path: plotnine/plotnine/geoms/geom_polygon.py
imports: from __future__ import annotations
  import typing
  import numpy
  from .._utils import SIZE_FACTOR, to_rgba
  from ..doctools import document
  from .geom import geom
label_desc: Use image node_id 4 for calling the geom_polygon obj's underlying member method code with example usage: obj.draw_legend(data, da, lyr) and returns: da