Skip to content

image function with large matrices

2 messages · cutcopy11

#
Hi, I am new to R. 

With the command below, I generated the image on the left in R.
On the right, with the same data (x,y,z in columns), I generated a similar
image in SigmaPlot.

If you look at the R image, one can see that the resolution is low.  Even
though the data
represents a 131 X 131 matrix, there appears to be only approximately 40 X
40 pixels.

I was wondering how I could generate an image in R that looks similar to the
to the one I produced
SigmaPlot.  Should I use a different function, such as heatmap or contour? 
I noticed that the interp function does not work with the heatmap function. 
Should I convert my xyz column data into a matrix to make things simpler?

There are also a few other questions that I have that could be helpful for
me in the future in regards to
legends, automated scaling, grids, and labeling, but I think I may ask those
at a later time or figure that out on my own.  But if you have some helpful
tips, please let me know.

Thanks,
Clay




image(interp(ytar_rcayrtgy$V2, ytar_rcayrtgy$V4, ytar_rcayrtgy$V5))


  http://r.789695.n4.nabble.com/file/n3466765/ytar_rcayrtgy.jpg 

http://r.789695.n4.nabble.com/file/n3466765/R_graph_thing.jpg 

--
View this message in context: http://r.789695.n4.nabble.com/image-function-with-large-matrices-tp3466765p3466765.html
Sent from the R help mailing list archive at Nabble.com.
#
I realized that my problem was not the image function but with the interp
function.

The default for the interp arguements xo and yo = 40, which is why I had a
40 X 40 square image.

Here is the revised command.

image(
  interp(
    ytar_rcayrtgy$V2, ytar_rcayrtgy$V4, ytar_rcayrtgy$V5, 
    xo=seq(min(ytar_rcayrtgy$V2), max(ytar_rcayrtgy$V2), length = 131),
    yo=seq(min(ytar_rcayrtgy$V4),max(ytar_rcayrtgy$V4), length = 131)
   )
)


--
View this message in context: http://r.789695.n4.nabble.com/image-function-with-large-matrices-tp3466765p3466879.html
Sent from the R help mailing list archive at Nabble.com.