Skip to content

image plot with color scale

2 messages · Witold E Wolski, Jim Lemon

#
I am plotting an image of correlations but need to add a color scale...

dat<-matrix(rnorm(1000),ncol=5)
labels=c("a","b","c","d","e")
cortmp <- cor(dat)

image(cortmp , axes = F )
axis( 1, at=seq(0,1,length=length(labels)) , labels=labels ,
cex.axis=0.8 ,srt = 45,las=2,cex=1)
axis( 2, at=seq(0,1,length=length(labels)) , labels=labels ,
cex.axis=0.8 ,srt = -45,las=1,cex=1)
image.plot(cortmp , axes = F )
axis( 1, at=seq(0,1,length=length(labels)) , labels=labels ,
cex.axis=0.8 ,srt = 45,las=2,cex=1)
axis( 2, at=seq(0,1,length=length(labels)) , labels=labels ,
cex.axis=0.8 ,srt = -45,las=1,cex=1)


but adding the axis fails... (the axis appears but the labls are not shown.

Can anyone can suggest an easy to use image function in R?

best
Witold
#
On 11/19/2013 10:07 PM, Witold E Wolski wrote:
Hi Witold,
You may find that color2D.matplot (plotrix) will do what you want.

Jim