class_docstr: Box and whiskers plot
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  width : float, default=None
      Box width. If `None`{.py}, the width is set to
      `90%` of the resolution of the data. Note that if the stat
      has a width parameter, that takes precedence over this one.
  outlier_alpha : float, default=1
      Transparency of the outlier points.
  outlier_color : str | tuple, default=None
      Color of the outlier points.
  outlier_shape : str, default="o"
      Shape of the outlier points. An empty string hides the outliers.
  outlier_size : float, default=1.5
      Size of the outlier points.
  outlier_stroke : float, default=0.5
      Stroke-size of the outlier points.
  notch : bool, default=False
      Whether the boxes should have a notch.
  varwidth : bool, default=False
      If `True`{.py}, boxes are drawn with widths proportional to
      the square-roots of the number of observations in the
      groups.
  notchwidth : float, default=0.5
      Width of notch relative to the body width.
  fatten : float, default=2
      A multiplicative factor used to increase the size of the
      middle bar across the box.
class_docstr_tok: ["Box","and","whiskers","plot","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","width",":","float",",","default=None","Box","width",".","If","`","None","`","{",".py","}",",","the","width","is","set","to","`","90","%","`","of","the","resolution","of","the","data",".","Note","that","if","the","stat","has","a","width","parameter",",","that","takes","precedence","over","this","one",".","outlier_alpha",":","float",",","default=1","Transparency","of","the","outlier","points",".","outlier_color",":","str","|","tuple",",","default=None","Color","of","the","outlier","points",".","outlier_shape",":","str",",","default=","''","o","''","Shape","of","the","outlier","points",".","An","empty","string","hides","the","outliers",".","outlier_size",":","float",",","default=1.5","Size","of","the","outlier","points",".","outlier_stroke",":","float",",","default=0.5","Stroke-size","of","the","outlier","points",".","notch",":","bool",",","default=False","Whether","the","boxes","should","have","a","notch",".","varwidth",":","bool",",","default=False","If","`","True","`","{",".py","}",",","boxes","are","drawn","with","widths","proportional","to","the","square-roots","of","the","number","of","observations","in","the","groups",".","notchwidth",":","float",",","default=0.5","Width","of","notch","relative","to","the","body","width",".","fatten",":","float",",","default=2","A","multiplicative","factor","used","to","increase","the","size","of","the","middle","bar","across","the","box","."]
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.lines import Line2D
      from matplotlib.patches import Rectangle
  
      # box
      facecolor = to_rgba(data["fill"], data["alpha"])
      if facecolor is None:
          facecolor = "none"
  
      kwargs = {
          "linestyle": data["linetype"],
          "linewidth": data["size"],
      }
  
      box = Rectangle(
          (da.width * 0.125, da.height * 0.25),
          width=da.width * 0.75,
          height=da.height * 0.5,
          facecolor=facecolor,
          edgecolor=data["color"],
          capstyle="projecting",
          antialiased=False,
          **kwargs,
      )
      da.add_artist(box)
  
      kwargs["solid_capstyle"] = "butt"
      kwargs["color"] = data["color"]
      kwargs["linewidth"] *= SIZE_FACTOR
  
      # middle strike through
      strike = Line2D(
          [da.width * 0.125, da.width * 0.875],
          [da.height * 0.5, da.height * 0.5],
          **kwargs,
      )
      da.add_artist(strike)
  
      # whiskers
      top = Line2D(
          [da.width * 0.5, da.width * 0.5],
          [da.height * 0.75, da.height * 0.9],
          **kwargs,
      )
      da.add_artist(top)
  
      bottom = Line2D(
          [da.width * 0.5, da.width * 0.5],
          [da.height * 0.25, da.height * 0.1],
          **kwargs,
      )
      da.add_artist(bottom)
      return da
  
file_path: plotnine/plotnine/geoms/geom_boxplot.py
imports: from __future__ import annotations
  import typing
  from warnings import warn
  import numpy
  import pandas
  from .._utils import SIZE_FACTOR, copy_missing_columns, resolution, to_rgba
  from ..doctools import document
  from ..exceptions import PlotnineWarning
  from ..positions import position_dodge2
  from ..positions.position import position
  from .geom import geom
  from .geom_crossbar import geom_crossbar
  from .geom_point import geom_point
  from .geom_segment import geom_segment
label_desc: Use image node_id 4 for calling the geom_boxplot obj's underlying member method code with example usage: obj.draw_legend(data, da, lyr) and returns: da