[R] gridBase and heatmap

Sean Davis sdavis2 at mail.nih.gov
Tue Sep 7 19:00:56 CEST 2004


I would like to use gridBase to place four separate heatmaps (actually,  
a stripped-down heatmap.2 from ght gregmisc package that contains only  
the "image" part) into four different viewports.  I can get the  
placement correct, but I keep 'losing' the previous plot.  Any  
suggestions?

Here is some quick example code trying to put a heatmap into the left  
viewport and then put a second one into the upper right.

Thanks in advance for insight....

Sean

 > pushViewport(viewport(layout = grid.layout(1, 3, widths =  
unit(rep(1,3), c("null", "cm", "null")))))
viewport[GRID.VP.177]
 > pushViewport(viewport(layout.pos.col=1))
viewport[GRID.VP.178]
 > par(omi=gridOMI(),new=T)
 > my.heatmap(eb$coefficients[(clsum[,1]>1) & (clsum[,2]>1) &  
(clsum[,3]==0),],breaks=c(seq(-2.5,-0.6,0.1), 
-0.1,0.10,seq(0.6,2.5,0.1)),dendrogram="none",Colv=c(9:12,5:8,1: 
4),labRow=rep('',520),margin=c(10,5),colsep=c(4,8),trace="none",density. 
info="none",col=greenred.colors(40),key=F)
 > popViewport()
viewport[GRID.VP.177]
 > pushViewport(viewport(layout.pos.col=3))
viewport[GRID.VP.179]
 > pushViewport(viewport(layout = grid.layout(3, 1, heights =  
unit(rep(1,3), c("null", "null", "null")))))
viewport[GRID.VP.180]
 > pushViewport(viewport(layout.pos.row=1))
viewport[GRID.VP.181]
 > par(omi=gridOMI(),new=T)
 > my.heatmap(eb$coefficients[(clsum[,1]>1) & (clsum[,2]>1) &  
(clsum[,3]==0),][tmp[505:520],],breaks=c(seq(-2.5,-0.6,0.1), 
-0.1,0.10,seq(0.6,2.5,0.1)),dendrogram="none",labRow=sapply(getSYMBOL(as 
.character(rownames(eb$coefficients[(clsum[,1]>1) & (clsum[,2]>1) &  
(clsum[,3]==0),])),'BrafPkg')[tmp[505:520]],function(x)  
{ifelse(is.na(x),"EST",x)}),Colv=c(9:12,5:8,1: 
4),margin=c(10,5),colsep=c(4,8),trace="none",density.info="none",col=gre 
enred.colors(40),key=F)




More information about the R-help mailing list