Created
August 11, 2011 14:48
-
-
Save kohske/1139848 to your computer and use it in GitHub Desktop.
ggplot2: example codes for matrix-like legend guide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p <- qplot(1:20, 1:20, col=letters[1:20]) | |
p + guides(col=guide_legend(nrow=8)) | |
p + guides(col=guide_legend(ncol=8)) | |
p + guides(col=guide_legend(nrow=8, byrow=T)) | |
p + guides(col=guide_legend(ncol=8, byrow=T)) | |
# output plots: http://yfrog.com/klhjpwp | |
# how to embed images in gist...? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you can install very very easily the develop version of ggplot2 on github thanks to Hadley's devtools package. | |
install.packages('devtools') | |
install.packages(c("RColorBrewer", "stringr", "dichromat", "munsell", "plyr", "colorspace")) # probably windows only | |
library(devtools) | |
dev_mode(TRUE) | |
install_github("scales") | |
install_github("ggplot2", "kohske", "feature/new-guides-with-gtable") | |
library(ggplot2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kohske