[R] Odp: image() plot with z not in matrix format

Petr PIKAL petr.pikal at precheza.cz
Thu Nov 29 13:07:12 CET 2007


Hi

library(akima)
a<-data.frame(rnorm(100), rnorm(100), runif(100)*100)
image(interp(a[,1], a[,2], a[,3]))

Petr
petr.pikal at precheza.cz

r-help-bounces at r-project.org napsal dne 29.11.2007 12:52:32:

> Hello R cracks
> 
> The image() function requires strictly increasing x and y values and z 
as a matrix.
> 
> Actually, I don't have equally spaced variables, but anyway want to plot 
an 
> colored image() (with z-information).
> 
> An example of my problem is here:
> 
> a<-data.frame(rnorm(100), rnorm(100), runif(100)*100)
> 
> How can I plot this data as an image (x=a[,1], y=a[,2] and z=a[,3])-> 
> according to ?image.
> It has to be possible to adapt the grid size so that every grid cell in 
the 
> plot is coloured consequently.
> 
> Thanks for your help
> 
> Marc
> --
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list