rgl

How to create heatmap illustraing mesh differences controlling the position of center color for divergence color palette?

好久不见. 提交于 2019-12-11 06:06:11
问题 I have two 3D meshes of human faces and I wish to use heatmap to illustrate differences. I want to use red-blue divergent color scale. My data can be found here. In my data, "vb1.xlsx" and "vb2.xlsx" contain 3D coordinates of the two meshes. "it.xlsx" is the face information. The "dat_col.xlsx" contains pointwise distances between the two meshes based on which heatmap could be produced. I used the following code to generate the two meshes based on vertex and face information. I then used the

Unicode in rgl plot3d

℡╲_俬逩灬. 提交于 2019-12-11 02:47:55
问题 I'm all new to R, and the rgl packageand having searched all over all day for a solution... I'm trying to use rgl's text3d function with unicode text. I have no problem plotting the same chars in 2D (using text()), but in 3D, instead of rendering the symbols it just writes out the UTF-8 char codes (unless they're ascii chars). I'm reading in data from file where the column "vowel" contains the symbols to be plotted (e.g. "e i ə ɪ ɒ" etc.), and cols "F1", "F2" and "F3" contain the values to be

Error running the packages “rgl' and ”geomorph" on R on Mac

自古美人都是妖i 提交于 2019-12-10 13:35:17
问题 I am trying to run the package "geomorph" on R. I know I need to install the packages "rgl' and "geomorph" and the following (respectively) to do so: install.packages("rgl") Then I: require("rgl") But for both the following error appeared: > require("rgl") Loading required package: rgl Error : .onLoad failed in loadNamespace() for 'rgl', details: call: dyn.load(file, DLLpath = DLLpath, ...) error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/rgl

Plotting ellipsoids / oblate spheroids in rgl

杀马特。学长 韩版系。学妹 提交于 2019-12-10 11:55:44
问题 I have been using rgl to plot spheres, but now I need to plot ellipsoids. The package includes ellipse3d ; however, this seems to be for fitting ellipsoids to data, using matrices and stuff I'm not very good at. What I want is a simple way to plot ellipsoids, in a similar way to spheres, using the centre coordinates and the scales in each direction. Can anyone help me out? 回答1: If you don't need the ellipse rotated around the axes, then you can just use a diagonal matrix for x (this plots a

Plot ellipse3d in R plotly?

梦想的初衷 提交于 2019-12-10 10:54:25
问题 Package rgl includes a very useful function ellipse3d , which can return an ellipsoid that cover like 95% percent of the points in 3D. Then this object can be used in rgl::plot3d to plot it out. My question is that is it possible to convert the output of ellipse3d to something that can be plotted through js plotting packages like plotly? library(rgl) dt <- cbind(x = rnorm(100), y = rnorm(100), z = rnorm(100)) ellipse <- ellipse3d(cov(dt)) plot3d(dt) plot3d(ellipse, add = T, color = "red",

Setting size of the rgl device

不打扰是莪最后的温柔 提交于 2019-12-09 17:38:56
问题 I have a problem with the fullscreen / non-fullscreen of my rgl device. Currently I use R 3.00 I plot a persp3d plot (library rgl) into my device, it opens in a quite small window: The R code: persp3d(x, y, z, theta=50, phi=25, expand=0.75, col=red, ticktype="detailed", xlab="", ylab="", zlab="",axes=FALSE) axes3d(c('x--','z')) axis3d(edge='y+-',at =c(1,500,1000,1500,2000,2320), labels =rownames(fd)[c(1,500,1000,1500,2000,2320)]) Which looks like this: I now rotated it and saved the single

plot3D - having two plots at once

淺唱寂寞╮ 提交于 2019-12-09 02:49:13
问题 plot3d() produces a 3d plot that I can twist around and rotate. But when I call plot3d() again, the previous plot goes away and is replaced by this one. How can I make it so that a new XQuartz window opens up rather than the old window being replaced by the new 3d plot. Essentially, I want two 3d plots opened at once. 回答1: like this: library(rgl) open3d() x <- sort(rnorm(1000)) y <- rnorm(1000) z <- rnorm(1000) + atan2(x,y) plot3d(x, y, z, col=rainbow(1000)) open3d() x <- sort(rnorm(20)) y <-

How to make 3D line plot in R (waterfall plot)

巧了我就是萌 提交于 2019-12-08 14:26:16
问题 I would like to create a waterfall plot in R (XYYY) from my data. So far, I use this code: load("myData.RData") ls() dim(data) ##matrix to xyz coords library(reshape2) newData <- melt(data, id="Group.1") dim(newData) head(newData) tail(newData) newDataO <- newData[c(2,1,3)] head(newDataO) ##color scale for z axis myColorRamp <- function(colors, values) { v <- (values - min(values))/diff(range(values)) x <- colorRamp(colors)(v) rgb(x[,1], x[,2], x[,3], maxColorValue = 255) } cols <-

Make a 3D rendered plot of time-series

随声附和 提交于 2019-12-08 05:44:18
问题 I have a set of 3D coordinates (below - just for a single point, in 3D space): x <- c(-521.531433, -521.511658, -521.515259, -521.518127, -521.563416, -521.558044, -521.571228, -521.607178, -521.631165, -521.659973) y <- c(154.499557, 154.479568, 154.438705, 154.398682, 154.580688, 154.365189, 154.3564, 154.559189, 154.341309, 154.344223) z <- c(864.379272, 864.354675, 864.365479, 864.363831, 864.495667, 864.35498, 864.358582, 864.50415, 864.35553, 864.359863) xyz <- data.frame(x,y,z) I need

Exporting rgl.snapshot and rgl.postscript fails

為{幸葍}努か 提交于 2019-12-07 23:12:09
问题 I am currently using the rgl package for some data representation. Here's my command mypath("directory") png(file=mypath, res=600, width=10.5, height= 10.5,units="in",bg = "transparent") require(rgl) set.seed(1) df <- data.frame(replicate(4,sample(1:200,1000,rep=TRUE))) colnames(df) <- c("var1","var2","var3","var4") plot3d(x=df$var1, y=df$var2, z=df$var3, col=as.numeric(df$var4), size=0.5, type='s',xlab="var1",ylab="var2",zlab="var3") rgl.snapshot(mypath) The command above works and produces