[R] persp & colors

Timur Elzhov Timur.Elzhov at jinr.ru
Sun Jun 1 19:21:10 CEST 2003


On Sun, Jun 01, 2003 at 06:53:55PM +0200, Uwe Ligges wrote:

>> but I'd like to persp()' colors behave like in image() function!

> That's not easy, because you have to redefine x, y and z values.
> 
> Simple example:
> 
>  x <- y <- 1:2
>  z <- matrix(1:4, 2)
>  image(x, y, z)    # OK, quite nice
> 
> but
> 
>  persp(x, y, z)
> 
> has only one facet. So the only way is to calculate the 9 values for x, 
> y, and z to get the corners for the 4 facets in it.
> That's easy for x and y, but can be impossible for z...

OK, thank you for answer!
But, I saw that other mathematic frameworks (CERN ROOT for instance)
can plot 3D surfaces with colors corresponding to z-value.
Is there way to do this in R (with another functions/packages)?
It's not necessary to use _one_ color per facet, yes?.. :)


--
WBR,
Timur.




More information about the R-help mailing list