Displaying 1 result from an estimated 1 matches for "draw_quantiles".
2018 Mar 07
0
ggplot2: plot gruped/nested split violins
...gscale, but
that is not important for this example). We have four groups for each
setting but there is a nested aspect to it.
Here is what I have tried:
-start-cut-and-paste-again---
GeomSplitViolin <- ggproto("GeomSplitViolin", GeomViolin,
draw_group = function(self, data, ..., draw_quantiles = NULL){
# By @YAK: https://stackoverflow.com/questions/35717353/split-violin-plot-with-ggplot2
data <- transform(data, xminv = x - violinwidth * (x - xmin),
xmaxv = x + violinwidth * (xmax - x))
grp <- data[1,'group']
newdata <- plyr::arrange(transform(data, x = if...