Skip to content
Prev 363449 / 398502 Next

pheatmap breaks

Hi Adrian,
I had to add an extra color, but this might do what you want:

chxx<-matrix(runif(100,-3.32,4.422),nrow=10)
chxx.cut<-as.numeric(cut(chxx,breaks=c(-3.5,-1.96,-1,0,1,1.96,5)))
chxx.col<-c("#0000FF","#8888FF","#AAAAFF","#FF8888","#FFAAAA",NA)[chxx.cut]
library(plotrix)
chxx_highcol<-color.scale(chxx[chxx>1.96],extremes=c("#FFAAAA","#FFFFFF"))
chxx.col<-matrix(chxx.col,nrow=10)
chxx.col[is.na(chxx.col)]<-chxx_highcol
color2D.matplot(chxx,cellcolors=chxx.col,show.values=TRUE)

Jim


On Sat, Aug 20, 2016 at 7:22 AM, Adrian Johnson
<oriolebaltimore at gmail.com> wrote: