[R] axes start at end of plot

2011-08-25 Thread Sumukh Sathnur
Hello all, I used the following script to generate a plot, but when I try to place axes, the axes start at the end of my plot and continue off the plot; the attached image shows what happens when I try to generate axes. library(fields) as.matrix(read.table("Matrix.txt", sep="\t"))->x #the mat

[R] Assigning colors to cells

2011-07-19 Thread Sumukh Sathnur
Hi everyone, I was wondering if there was a simple way to assign a color to a cell based on value in a data frame and return the cell as an image? For example, if the value is >1, then blue, if between 1 and 2, green, if between 2 and 3, yellow, etc. I tried using a heatmap function but I wa

[R] Legend in image.plot( )

2011-07-28 Thread Sumukh Sathnur
Hello all, Using image.plot from the fields package, I created a heatmap for a matrix I had saved as a text file. Everything works fine, but my legend goes up to a value of 300 (the maximum value in my matrix) whereas my scale goes up to 20 for assigning colors. Is there any way to truncate t