[R] how to rotate a triangle image(ZMAT) ?

Cleber N.Borges klebyn at yahoo.com.br
Tue Jun 27 19:25:20 CEST 2006


 Hello R users...

 how to align this Zmat (triangle image)  in X axis?
 I would like that the triangle's base become in the X
axis and
 the triangle's height become in the Y axis 

 Is there some trick for make this?

 Thanks.
 Cleber
 

######################## my test and try
 f <- function(x,y){
 z=1-x-y
 z[ z < (-1e-15) ] <- NA 
 return( -100*x+0*y+100*z )
 }

 x = seq( 1, 0, by = -0.01 )
 y = seq( 1, 0, by = -0.01 )
 zmat =  outer(x,y,f)

 image(zmat,  col=terrain.colors(10))
 contour(zmat, add=T)



More information about the R-help mailing list