gghalves icon indicating copy to clipboard operation
gghalves copied to clipboard

Add split violin and split sina

Open jdlee opened this issue 4 years ago • 1 comments

It would be very useful to be able to create split violin plots such as this: https://stackoverflow.com/questions/35717353/split-violin-plot-with-ggplot2

Extending this functionality to sina plots would be extremely useful: https://ggforce.data-imaginist.com/reference/geom_sina.html

jdlee avatar Mar 29 '21 14:03 jdlee

Hi, that's a great suggestion 😄 I've added an optional split aesthetic to the half-violin plot, see example below:

ggplot() +
  geom_half_violin(
    data = ToothGrowth, 
    aes(x = as.factor(dose), y = len, split = supp, fill = supp),
    position = "identity"
  ) + 
  theme_minimal()

image

Hope it's still of use !

erocoar avatar May 26 '22 16:05 erocoar