class_docstr: Violin Plot
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  draw_quantiles : float | list[float], default=None
      draw horizontal lines at the given quantiles (0..1)
      of the density estimate.
  style : str, default="full"
      The type of violin plot to draw. The options are:
  
      ```python
      'full'        # Regular (2 sided violins)
      'left'        # Left-sided half violins
      'right'       # Right-sided half violins
      'left-right'  # Alternate (left first) half violins by the group
      'right-left'  # Alternate (right first) half violins by the group
      ```
class_docstr_tok: ["Violin","Plot","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","draw_quantiles",":","float","|","list","[","float","]",",","default=None","draw","horizontal","lines","at","the","given","quantiles","(","0","..","1",")","of","the","density","estimate",".","style",":","str",",","default=","''","full","''","The","type","of","violin","plot","to","draw",".","The","options","are",":","``","`","python","'full","'","#","Regular","(","2","sided","violins",")","'left","'","#","Left-sided","half","violins","'right","'","#","Right-sided","half","violins","'left-right","'","#","Alternate","(","left","first",")","half","violins","by","the","group","'right-left","'","#","Alternate","(","right","first",")","half","violins","by","the","group","``","`"]
code: def setup_data(self, data: pd.DataFrame) -> pd.DataFrame:
      if "width" not in data:
          if self.params["width"]:
              data["width"] = self.params["width"]
          else:
              data["width"] = resolution(data["x"], False) * 0.9
  
      def func(df: pd.DataFrame) -> pd.DataFrame:
          df["ymin"] = df["y"].min()
          df["ymax"] = df["y"].max()
          df["xmin"] = df["x"] - df["width"] / 2
          df["xmax"] = df["x"] + df["width"] / 2
          return df
  
      # This is a plyr::ddply
      data = groupby_apply(data, ["group", "PANEL"], func)
      return data
  
file_path: plotnine/plotnine/geoms/geom_violin.py
imports: from __future__ import annotations
  import typing
  import numpy
  import pandas
  from .._utils import groupby_apply, interleave, resolution
  from ..doctools import document
  from .geom import geom
  from .geom_path import geom_path
  from .geom_polygon import geom_polygon
label_desc: Use image node_id 2 for calling the geom_violin obj's underlying member method code with example usage: obj.setup_data(data) and returns: data, df