Created
July 8, 2012 08:02
-
-
Save gufodotto/3069892 to your computer and use it in GitHub Desktop.
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
grid.newpage() | |
# create a tile matrix with 0 and 1 depending on which parameter is being fitted. | |
cl1<-ggplot(Coll_m) + geom_tile(aes(X1, X2, fill=value), , col='white') + scale_fill_gradient(low='white', high='black', limits=c(0, 1)) | |
# fill the same matrix with tiles of two different colors | |
cl1<-cl1 + geom_text(aes(X1, X2, label=value, col=value)) + scale_color_gradient(low='black', high='white', limits=c(0, 1)) | |
cl1<-cl1 + opts(title="Parameters' N-ways Identifiability", axis.title.x = theme_blank(), axis.title.y = theme_blank(), axis.text.y = theme_text(colour = NA), axis.ticks = theme_segment(colour = NA), axis.text.x = theme_text(size = 12), legend.position='none') | |
# now, on the right side, fill colors depending on the collinearity values | |
cl2<-ggplot(Coll_f) + geom_tile(aes(X1, X2, fill=flag), col='white') + scale_fill_manual(values=c('green','red')) | |
# finally print clipped collinearity values | |
cl2<-cl2 + geom_text(data=Coll_f, aes(X1, X2, label=label), col='black') + theme_bw() + guides(fill=guide_legend(title=NULL)) + | |
# and all options to make the graph look right | |
opts(title="", axis.title.x = theme_blank(), axis.title.y = theme_blank(), axis.text.y = theme_text(colour = NA), axis.ticks = theme_segment(colour = NA), axis.text.x = theme_text(size = 12), legend.position='none') | |
pushViewport(viewport(layout = grid.layout(6, 7))); | |
print(cl1, vp=vplayout(1:6,1:5)) | |
print(cl2, vp=vplayout(1:6,6:7)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment