[R-br] Legenda com gradientes-valores em superfície resposta!

Ivan Bezerra Allaman ivanalaman em yahoo.com.br
Quarta Junho 8 15:47:13 BRT 2011


Walmes!

Valeu pela dica, mais meu sangue não bate com a lattes. rsrsrsrsrs. Bem, eu encontrei uma solução com a graphics. Segue abaixo para aqueles que se interessarem. 

layout(matrix(c(1,2),1,2,byrow=T),widths=c(4,1))
     x <- seq(-1.95, 1.95, length = 30)
     y <- seq(-1.95, 1.95, length = 35)
     z <- outer(x, y, function(a,b) a*b^2)
     nrz <- nrow(z)
     ncz <- ncol(z)
     # Create a function interpolating colors in the range of specified colors
     jet.colors <- colorRampPalette( c("blue", "green") ) 
     # Generate the desired number of colors from this palette
     nbcol <- 100
     color <- jet.colors(nbcol)
     # Compute the z-value at the facet centres
     zfacet <- z[-1, -1] + z[-1, -ncz] + z[-nrz, -1] + z[-nrz, -ncz]
     # Recode facet z-values into color indices
     facetcol <- cut(zfacet, nbcol)
     persp(x, y, z, col=color[facetcol], phi=30, theta=-30)
col.labels <- c("0.0","0.2","0.4","0.6","0.8","1.0")#intervalo de valores do Z.
plot(0:10,type="n",axes=FALSE,xlab="",ylab="") 
color.legend(1,1.5,9,8,col.labels,color,gradient="y",align="rb")

Allaman
(S,f,P)

 
 
M.Sc Ivan Bezerra Allaman 
Zootecnista
Doutorando em Produção Animal/Aquicultura - UFLA 
email e msn - ivanalaman em yahoo.com.br 
Tel: (35)3826-6608/9900-2924
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20110608/e17d5a7f/attachment.html>


Mais detalhes sobre a lista de discussão R-br