I'm trying to create a violin plot in R from count data. The data I use is a number of mutations that is found in each sample for each source.
It looks something like this but then for more than a thousand rows:
mutations names 1 6 1kG 2 6 1kG 3 6 1kG 4 6 1kG 5 6 1kG 6 6 1kG 7 6 1kG 8 6 1kG 9 5 1kG 10 5 1kG 11 5 1kG I already use the code below to create several plots.
ggplot(df_combined, aes(factor(names), y=mutations)) + geom_violin() + geom_boxplot(width=.1, outlier.size=0, fill="grey50") + stat_summary(fun.y=median, geom="point", fill="white", shape=21, size=4) + xlab("Source") + ylab("Number of mutations") + theme(axis.text = element_text(colour = "black"))`While most of them show up just fine, some of them start to 'wobble' (best way I can explain it) Here is a link to an example that doesn't work.
I guess this is because my data is discrete and not continuous but I can't find anything on how to change this for the violin plot. Is there any way I can get this to work with ggplot2 and geom_violin?
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2