Skip to content

Instantly share code, notes, and snippets.

View GuangchuangYu's full-sized avatar
🎯
Focusing

Guangchuang Yu GuangchuangYu

🎯
Focusing
View GitHub Profile
@GuangchuangYu
GuangchuangYu / violin_plot.R
Created February 8, 2012 03:51
generate violin plot using ggplot2
p <- ggplot(mtcars, aes(factor(cyl),mpg,
fill=factor(cyl),
colour=factor(cyl)))
p1 <- p+geom_violin(alpha=0.3, width=0.5) +
geom_boxplot(width=0.2, outlier.colour=NA)
p2 <- p+geom_violin(alpha=0.3, width=0.5) +
geom_dotplot(binaxis='y', stackdir='center', dotsize=0.5)
@GuangchuangYu
GuangchuangYu / emacs.md
Last active August 29, 2015 14:14
emacs for R
@GuangchuangYu
GuangchuangYu / subview.md
Last active August 26, 2015 13:13
embed subview in ggplot2
require(grid)
require(ggplot2)
require(magrittr)

theme_transparent <- function(...) {
    theme(panel.background = element_rect(
              fill = "transparent",
              colour = NA),
 plot.background = element_rect(