Re: [R] Violin Plot - using ggplot2

2011-03-30 Thread JP
Sorry for the cross post - but I will post your answer in the other place too for completeness And thanks for your answer... that is brilliant especially the second transparent plot Fantastic On 30 March 2011 12:21, ONKELINX, Thierry wrote: > Dear JP, > > Please do not cross post between lis

Re: [R] Violin Plot - using ggplot2

2011-03-30 Thread ONKELINX, Thierry
Dear JP, Please do not cross post between lists. Here is a possible solution. library(ggplot2) p <- rep(c(rep("condition_a", 4), rep("condition_b", 4)), 2) q <- c(rep("grp_1", 8), rep("grp_2", 8)) r <- sample(1:5, 16, rep = T) d <- data.frame(p, q, r) ggplot(d, aes(x = r)) + geom_ribbon(aes(ymax