Split violin plot with ggplot2

Or, to avoid fiddling with the densities, you could extend ggplot2‘s GeomViolin like this: GeomSplitViolin <- ggproto(“GeomSplitViolin”, GeomViolin, draw_group = function(self, data, …, draw_quantiles = NULL) { data <- transform(data, xminv = x – violinwidth * (x – xmin), xmaxv = x + violinwidth * (xmax – x)) grp <- data[1, “group”] newdata <- plyr::arrange(transform(data, … Read more