2
votes

I want to make a heat map of correlated data and instead of getting the correlation scale from 0.85, I want it from 0.90. I need to know how can I tweak this scale.

enter image description here

The commands I am using are:

data<-read.table("data_corr", header=T) 
tiff('corrheatmap.tiff')
library(gplots)
z<-cor(data)
lowColor = "purple" #change this if you want
highColor = "blue" #change this if you want
colorMin = 0 # I have made this 0.9 and also 90 in any case I don't see the difference
heatmap.2(z, Rowv=FALSE, Colv=FALSE, dendrogram="none", key=TRUE, density.info="none", trace="none", col=colorpanel(100, lowColor, highColor), scale="none", cexRow=0.15, cexCol=0.15) 
1
I would vote for levelplot from library(lattice). - danas.zuokas
library(lattice); levelplot(z) For me it looks nicer. However I do not know how to change colorkey scale. - danas.zuokas

1 Answers

2
votes

Maybe I misunderstood your question, but I think you can use the breaks argument. For me it works like

heatmap.2(z, breaks = seq(0.9, 1, 0.001), Rowv=FALSE, Colv=FALSE, dendrogram="none", key=TRUE, density.info="none", cexRow = 0.15, cexCol = 0.15, col=colorpanel(100, lowColor, highColor), trace="none")