View source: R/plot_functions.R
geom_split_violin | R Documentation |
Draws split violin plot using ggplot2. Credit to jan-glx (https://stackoverflow.com/questions/35717353/split-violin-plot-with-ggplot2)
geom_split_violin(
mapping = NULL,
data = NULL,
stat = "ydensity",
position = "identity",
...,
draw_quantiles = NULL,
trim = TRUE,
scale = "area",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
ggplot mapping |
data |
data.frame |
stat |
ggplot identity |
position |
ggplot position |
... |
additional parameters to pass to layer() |
draw_quantiles |
draw quantiles. Default is NULL |
trim |
Trim data. Default is True. |
scale |
Default is area. |
na.rm |
Default is na.rm |
show.legend |
Default is NA |
inherent.aes |
Default is TRUE |
ggplot object
# split violin plot
ggplot(my_data, aes(x, y, fill = m)) + geom_split_violin()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.