search for: colorlut

Displaying 6 results from an estimated 6 matches for "colorlut".

2011 Jul 31
3
export/import matrix
...104 105 105 105 105 105 104 104 103 104 104 105 105 I use this data to represent a 3D map with the follwing script and it works PEFECT! > y<- 2*data > x <- 10* (1:nrow(y)) > z <- 10* (1:ncol(y)) > ylim <- range(y) > ylen <-ylim[2] - ylim[1] + 1 > colorlut <- terrain.colors(ylen) > col <- colorlut[y-ylim[1] + 1] > rgl.open() > rgl.surface(x,z,y, color=col, back="lines") Then I export it as write.table(data, file="datam.txt", row.names=TRUE, col.names=TRUE), when I import it back into R again with read.table(&quot...
2012 May 02
1
rgl.Sweave not producing transparency in pdf plots with alpha
...eight=5, resolution=100, outputtype=pdf, pdf=TRUE>>= library(rgl) data(volcano) z <- 2 * volcano # Exaggerate the relief x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N) y <- 10 * (1:ncol(z)) # 10 meter spacing (E to W) zlim <- range(y) zlen <- zlim[2] - zlim[1] + 1 colorlut <- terrain.colors(zlen) # height color lookup table col <- colorlut[ z-zlim[1]+1 ] # assign colors to heights for each point #open3d() surface3d(x, y, z, color=col, back="lines", alpha=0.75) @ \end{figure} \end{document}
2006 Feb 20
1
Further rgl()/spheres3d() query
...o the text3d() command only seems to work for a couple of the positions, with no text added in most cases. Could anyone offer any suggestions? g.pca <- prcomp(RtG , retx = TRUE) scale <- 0.4 bg3d("black") amp <- 6 zlim <- amp*range(z) zlen <- (zlim[2] - zlim[1])*100 colorlut <- terrain.colors(zlen) # height color lookup table col <- colorlut[ ((z*amp)-zlim[1])*100+1 ] # assign colors to heights surface3d(x,y,z*amp,color=col) for (i in 1:30) { for (i in 1) { pc <- g.pca$rotation[,i] pc.pos <- (pc > 0) if (any(pc.pos)) { spheres3d(xval[pc.pos],yva...
2009 Jun 16
1
color gradation inversion.
Dear list I'm having trouble with inverting color gradation. As seen in the "rgl" example, library(rgl) example(rgl.surface) I understand that I can assign colors to heights for each point. col <- colorlut[ y-ylim[1]+1 ] # assign colors to heights for each point However, I am now trying to assign inverted colors. (top colored green, and bottom colored gray). Is there any way that I can do this? Thanks. NI
2017 Oct 19
1
overlaying points and lines on a surface3d rgl plot with axes
Hi R users and experts, I am interested in learning more about the use of 3D plots. Specifically, I want to add points and lines to a surface plot. And get the axes and labels plotted also. Here is what I have tried with an example data set : library(rgl) vol2 <- 2*volcano # Exaggerate the relief library(reshape) mvol2 <- melt(vol2) str(mvol2) # First, persp and persp3d plots do not succeed
2009 Jun 16
0
color gradation inversion.
..., Naoki Irie wrote: > Dear list > > > I'm having trouble with inverting color gradation. > > As seen in the "rgl" example, > > library(rgl) > example(rgl.surface) > > I understand that I can assign colors to heights for each point. > > col <- colorlut[ y-ylim[1]+1 ] # assign colors to heights for each > point > > However, I am now trying to assign inverted colors. > (top colored green, and bottom colored gray). > > Is there any way that I can do this? David Winsemius, MD Heritage Laboratories West Hartford, CT