class_docstr: Base class of all Geoms
class_docstr_tok: ["Base","class","of","all","Geoms"]
docstr: Modify the data before drawing takes place
  
  This function is called *before* position adjustments are done.
  It is used by geoms to create the final aesthetics used for
  drawing. The base class method does nothing, geoms can override
  this method for two reasons:
  
  1. The `stat` does not create all the aesthetics (usually
     position aesthetics) required for drawing the `geom`,
     but those aesthetics can be computed from the available
     data. For example [](`~plotnine.geoms.geom_boxplot`)
     and [](`~plotnine.geoms.geom_violin`).
  
  2. The `geom` inherits from another `geom` (superclass) which
     does the drawing and the superclass requires certain aesthetics
     to be present in the data. For example
     [](`~plotnine.geoms.geom_tile`) and
     [](`~plotnine.geoms.geom_area`).
  
  Parameters
  ----------
  data :
      Data used for drawing the geom.
  
  Returns
  -------
  :
      Data used for drawing the geom.
docstr_tok: ["Modify","the","data","before","drawing","takes","place","This","function","is","called","*","before","*","position","adjustments","are","done",".","It","is","used","by","geoms","to","create","the","final","aesthetics","used","for","drawing",".","The","base","class","method","does","nothing",",","geoms","can","override","this","method","for","two","reasons",":","1",".","The","`","stat","`","does","not","create","all","the","aesthetics","(","usually","position","aesthetics",")","required","for","drawing","the","`","geom","`",",","but","those","aesthetics","can","be","computed","from","the","available","data",".","For","example","[","]","(","`","~plotnine.geoms.geom_boxplot","`",")","and","[","]","(","`","~plotnine.geoms.geom_violin","`",")",".","2",".","The","`","geom","`","inherits","from","another","`","geom","`","(","superclass",")","which","does","the","drawing","and","the","superclass","requires","certain","aesthetics","to","be","present","in","the","data",".","For","example","[","]","(","`","~plotnine.geoms.geom_tile","`",")","and","[","]","(","`","~plotnine.geoms.geom_area","`",")",".","Parameters","--","--","--","--","--","data",":","Data","used","for","drawing","the","geom",".","Returns","--","--","--","-",":","Data","used","for","drawing","the","geom","."]
code: def setup_data(self, data: pd.DataFrame) -> pd.DataFrame:
      """
      Modify the data before drawing takes place
  
      This function is called *before* position adjustments are done.
      It is used by geoms to create the final aesthetics used for
      drawing. The base class method does nothing, geoms can override
      this method for two reasons:
  
      1. The `stat` does not create all the aesthetics (usually
         position aesthetics) required for drawing the `geom`,
         but those aesthetics can be computed from the available
         data. For example [](`~plotnine.geoms.geom_boxplot`)
         and [](`~plotnine.geoms.geom_violin`).
  
      2. The `geom` inherits from another `geom` (superclass) which
         does the drawing and the superclass requires certain aesthetics
         to be present in the data. For example
         [](`~plotnine.geoms.geom_tile`) and
         [](`~plotnine.geoms.geom_area`).
  
      Parameters
      ----------
      data :
          Data used for drawing the geom.
  
      Returns
      -------
      :
          Data used for drawing the geom.
      """
      return data
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from copy import deepcopy
  from itertools import chain, repeat
  from .._utils import copy_keys, data_mapping_as_kwargs, is_list_like, remove_missing
  from .._utils.registry import Register, Registry
  from ..exceptions import PlotnineError
  from ..layer import layer
  from ..mapping.aes import is_valid_aesthetic, rename_aesthetics
  from ..mapping.evaluation import evaluate
  from ..positions.position import position
  from ..stats.stat import stat
label_desc: Use image node_id 5 for calling the geom obj's underlying member method code with example usage: obj.setup_data(data) and returns: data