[R] gridBase and heatmap

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


Kevin,

Thanks for the advice.  However, I was pretty careful to include a  
par(new=T) [see below].

Sean



On Sep 7, 2004, at 1:14 PM, Kevin Bartz wrote:

> The problem is that most base plotting functions first wipe the  
> graphics
> device clean. To do what you want, you need to use par(new = T)  
> liberally
> between plots. Does that work for you?
>
> Kevin
>
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Sean Davis
> Sent: Tuesday, September 07, 2004 10:01 AM
> To: r-help
> Subject: [R] gridBase and heatmap
>
> 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(a 
> s
> .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=gr 
> e
> enred.colors(40),key=F)
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html




More information about the R-help mailing list