Skip to content

Instantly share code, notes, and snippets.

@thomaskern
Created July 8, 2011 18:31
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 thomaskern/1072457 to your computer and use it in GitHub Desktop.
Save thomaskern/1072457 to your computer and use it in GitHub Desktop.
library(ggplot2)
data = data.frame(x=rep(c("M1", "M2","M3","M4"),3), y=runif(12,10,20), group=c(rep("B",3), rep("A",3), rep("C",3),rep("D",3)))
p = ggplot(data,aes(x=x,y=y))
p = p + facet_grid(. ~ group)
p = p + geom_point()
print(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment