[R] problems with image.plot()

Sumukh Sathnur sumukh.sathnur at gmail.com
Sat Jul 30 00:38:02 CEST 2011


Hi all,

I used image.plot() to create a heat map of a matrix:

as.matrix(read.table("Matrix.txt", sep="\t"))->x
HeatBrk<-seq(5,25,2.5)
MyCol= gray((7:0)/7)
library(fields)
image.plot(x, col=MyCol, breaks=HeatBrk, legend.shrink=0.3)

dev.copy(device=pdf, file="HEAT4!.pdf", height=8, width=8)
dev.off()



There are a few things that I would like to do that I can't seem to find 
help with online:

1) Add axes to the bottom and left that go from 1:ncol(x) ; in this 
case, 104. Every time I try to add axes in some form or another they 
either go through the center of the image or do not show up at all.

2) Limit the scale of the legend from the minimum value to the maximum 
value that I assign a color to; as of now it goes from the minimum value 
(0) to the maximum value (300) but I would like it to stop at 25.

3) Rotate the resulting image 90 degrees to the right. Is there a 
generic way to do this? everything I have found online is case-specific 
and extremely complicated...

I know this is a lot to ask, but I've been stuck on these for a few days 
and I can't seem to figure them out. Any help would be appreciated.


Thanks in advance,
Sumukh

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HEAT4!.pdf
Type: application/pdf
Size: 49684 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110729/851ea5ad/attachment.pdf>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Matrix.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20110729/851ea5ad/attachment.txt>


More information about the R-help mailing list