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","."]
code: def setup_data(self, data: pd.DataFrame) -> pd.DataFrame:
      if "width" not in data:
          width = self.params.get("width", None)
          if width is not None:
              data["width"] = width
          else:
              data["width"] = resolution(data["x"], False) * 0.9
  
      if "outliers" not in data:
          data["outliers"] = [[] for i in range(len(data))]
  
      # min and max outlier values
      omin = [
          np.min(lst) if len(lst) else +np.inf
          for lst in data["outliers"]
      ]
      omax = [
          np.max(lst) if len(lst) else -np.inf
          for lst in data["outliers"]
      ]
  
      data["ymin_final"] = np.min(
          np.column_stack([data["ymin"], omin]), axis=1
      )
      data["ymax_final"] = np.max(
          np.column_stack([data["ymax"], omax]), axis=1
      )
  
      # if varwidth not requested or not available, don't use it
      if (
          "varwidth" not in self.params
          or not self.params["varwidth"]
          or "relvarwidth" not in data
      ):
          data["xmin"] = data["x"] - data["width"] / 2
          data["xmax"] = data["x"] + data["width"] / 2
      else:
          # make relvarwidth relative to the size of the
          # largest group
          data["relvarwidth"] /= data["relvarwidth"].max()
          data["xmin"] = (
              data["x"] - data["relvarwidth"] * data["width"] / 2
          )
          data["xmax"] = (
              data["x"] + data["relvarwidth"] * data["width"] / 2
          )
          del data["relvarwidth"]
  
      del data["width"]
  
      return data
  
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 2 for calling the geom_boxplot obj's underlying member method code with example usage: obj.setup_data(data) and returns: data