Skip to content
Prev 32732 / 398525 Next

persp & colors

Timur Elzhov wrote:
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...

Uwe Ligges