[R] image plot

Jim Lemon jim at bitwrit.com.au
Tue Aug 25 12:39:22 CEST 2009


ogbos okike wrote:
> Hi,
> I am trying to use the image function to do a color plot. My matrix columns
> are labeled y and x. I tried >image(y, x) but I had error message ("Error in
> image.default(y, x) : increasing 'x' and 'y' values expected").
> Could anybody please tell me how to add these increasing 'x' and 'y' values.
>   
Hi Ogbos,
I think you may be passing the values that you want displayed rather 
than the positions of those values on a 2D grid. Try sending your matrix 
to color2D.matplot in the plotrix package. That just converts the values 
into colors and may be more like what you want.

Jim




More information about the R-help mailing list