Skip to content

Instantly share code, notes, and snippets.

@arq5x
Created January 7, 2011 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arq5x/769496 to your computer and use it in GitHub Desktop.
Save arq5x/769496 to your computer and use it in GitHub Desktop.
Example of using qplot for a bar plot colored by sample or populations
library(ggplot2)
library(gridExtra)
cov <- read.table("/Users/arq5x/Documents/Projects/HallLab/TCGA-1KG/ForKeystone/tcga_and_1kg_span_cov.txt",header=TRUE)
span <- qplot(sample, span_cov, data=cov, fill=factor(type_num), geom="bar",
binwidth=1,
xlab="Sample",
ylab="Spanning coverage") +
opts(axis.ticks = theme_blank(),
axis.text.x = theme_blank(),
axis.title.x = theme_text(size = 18, face = "bold"),
axis.title.y = theme_text(size = 18, face = "bold", angle=90),
axis.text.y = theme_text(size=16))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment