class_docstr: Density estimate
  
  {usage}
  
  Parameters
  ----------
  {common_parameters}
  kernel : str, default='gaussian'
      Kernel used for density estimation. One of:
  
      ```python
      "biweight"
      "cosine"
      "cosine2"
      "epanechnikov"
      "gaussian"
      "triangular"
      "triweight"
      "uniform"
      ```
  adjust : float, default=1
      An adjustment factor for the `bw`. Bandwidth becomes
      `bw * adjust`{.py}.
      Adjustment of the bandwidth.
  trim : bool, default=False
      This parameter only matters if you are displaying multiple
      densities in one plot. If `False`{.py}, the default, each
      density is computed on the full range of the data. If
      `True`{.py}, each density is computed over the range of that
      group; this typically means the estimated x values will not
      line-up, and hence you won't be able to stack density values.
  n : int, default=1024
      Number of equally spaced points at which the density is to
      be estimated. For efficient computation, it should be a power
      of two.
  bw : str | float, default="nrd0"
      The bandwidth to use, If a float is given, it is the bandwidth.
      The `str` choices are:
  
      ```python
      "nrd0"
      "normal_reference"
      "scott"
      "silverman"
      ```
  
      `nrd0` is a port of `stats::bw.nrd0` in R; it is eqiuvalent
      to `silverman` when there is more than 1 value in a group.
  scale : Literal["area", "count", "width"], default="area"
      How to scale the violins. The options are:
      If `area` all violins have the same area, before trimming the tails.
      If `count` the areas are scaled proportionally to the number of
      observations.
      If `width` all violins have the same maximum width.
  
  See Also
  --------
  plotnine.geoms.geom_violin
  statsmodels.nonparametric.kde.KDEUnivariate
  statsmodels.nonparametric.kde.KDEUnivariate.fit
class_docstr_tok: ["Density","estimate","{","usage","}","Parameters","--","--","--","--","--","{","common_parameters","}","kernel",":","str",",","default='gaussian'","Kernel","used","for","density","estimation",".","One","of",":","``","`","python","``","biweight","''","``","cosine","''","``","cosine2","''","``","epanechnikov","''","``","gaussian","''","``","triangular","''","``","triweight","''","``","uniform","''","``","`","adjust",":","float",",","default=1","An","adjustment","factor","for","the","`","bw","`",".","Bandwidth","becomes","`","bw","*","adjust","`","{",".py","}",".","Adjustment","of","the","bandwidth",".","trim",":","bool",",","default=False","This","parameter","only","matters","if","you","are","displaying","multiple","densities","in","one","plot",".","If","`","False","`","{",".py","}",",","the","default",",","each","density","is","computed","on","the","full","range","of","the","data",".","If","`","True","`","{",".py","}",",","each","density","is","computed","over","the","range","of","that","group",";","this","typically","means","the","estimated","x","values","will","not","line-up",",","and","hence","you","wo","n't","be","able","to","stack","density","values",".","n",":","int",",","default=1024","Number","of","equally","spaced","points","at","which","the","density","is","to","be","estimated",".","For","efficient","computation",",","it","should","be","a","power","of","two",".","bw",":","str","|","float",",","default=","''","nrd0","''","The","bandwidth","to","use",",","If","a","float","is","given",",","it","is","the","bandwidth",".","The","`","str","`","choices","are",":","``","`","python","``","nrd0","''","``","normal_reference","''","``","scott","''","``","silverman","''","``","`","`","nrd0","`","is","a","port","of","`","stats",":",":bw.nrd0","`","in","R",";","it","is","eqiuvalent","to","`","silverman","`","when","there","is","more","than","1","value","in","a","group",".","scale",":","Literal","[","``","area","''",",","``","count","''",",","``","width","''","]",",","default=","''","area","''","How","to","scale","the","violins",".","The","options","are",":","If","`","area","`","all","violins","have","the","same","area",",","before","trimming","the","tails",".","If","`","count","`","the","areas","are","scaled","proportionally","to","the","number","of","observations",".","If","`","width","`","all","violins","have","the","same","maximum","width",".","See","Also","--","--","--","--","plotnine.geoms.geom_violin","statsmodels.nonparametric.kde.KDEUnivariate","statsmodels.nonparametric.kde.KDEUnivariate.fit"]
code: def setup_data(self, data):
      if "x" not in data:
          data["x"] = 0
      return data
  
file_path: plotnine/plotnine/stats/stat_ydensity.py
imports: from contextlib import suppress
  import numpy
  import pandas
  from ..doctools import document
  from ..exceptions import PlotnineError
  from .stat import stat
  from .stat_density import compute_density, stat_density
label_desc: Use image node_id 1 for calling the stat_ydensity obj's underlying member method code with example usage: obj.setup_data(data) and returns: data