0

I want to make a violin plot using geom_violin that mimics the structure of violin plots. i.e. it shows 95% confidence interval, interquartile range and median within the desnity plots.

I am trying to do this but only getting median points and error.

p <- ggplot(df2, aes(x = col1, y = col2, fill = col1)) + 

geom_violin(scale = "width")

p + geom_pointrange(mapping = aes(x = col1, y = col2), stat = "summary" ,fun.ymax = max, fun.ymin = min, fun.y = median)

but I am getting this error:

Warning message: Ignoring unknown parameters: fun.ymax, fun.ymin, fun.y

Any help would be appreciated. Thanks.

Lily Sharpton
  • 149
  • 1
  • 6
  • 1
    Please add data using `dput(df2)`. Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269). – Ronak Shah Aug 18 '20 at 02:17
  • 1
    Does this answer your question? [Median and quartile on violin plots in ggplot2](https://stackoverflow.com/questions/17319487/median-and-quartile-on-violin-plots-in-ggplot2) – Ben Norris Aug 18 '20 at 02:55

0 Answers0