Re: [R] How to add legend for image()?

2007-10-03 Thread Jim Lemon
zhijie zhang wrote: Dear friends, The following is an example to explain my question. I want to get a legend which will show the z-values according to different colors in image() function. x-sort(runif(10)) #x-coordinates y-sort(runif(10)) #y-coordinates z-matrix(runif(100),nrow=10)

[R] How to add legend for image()?

2007-10-02 Thread zhijie zhang
Dear friends, The following is an example to explain my question. I want to get a legend which will show the z-values according to different colors in image() function. x-sort(runif(10)) #x-coordinates y-sort(runif(10)) #y-coordinates z-matrix(runif(100),nrow=10) #attributes values

Re: [R] How to add legend for image()?

2007-10-02 Thread Eric Thompson
Have you tried filled.contour()? It automatically generates a legend. However, I'm not sure what is going on with your x's and y's being sorted random numbers. I assume your actual data are not like this. If you do not have data in an equally spaced grid you may need to create one by some sort of