English 中文(简体)
作出3D规定的时序
原标题:Make a 3D rendered plot of time-series

我有一套3D坐标(低于3D空间的单一点):

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)

我需要用3D的原样来安排时间(以便我能够轮渡地等等)。 该地块将适时显示上述点的轨迹(例如固体线)。 I used http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/R.basic/html/plot3d.html 方法,但我可以把它推向时间序列(下文只是从时间序列的第一个框架点点推):

require(rgl)    
plot3d(xyz[1,1],xyz[1,2],xyz[1,3],axes=F,xlab="",ylab="",zlab="") 

我发现,但并未真正处理实时提供的3D地块。 请提出任何建议。 谢谢。

最佳回答
问题回答

如果你读到<条码> 帮助(用户3d),你可看到如何打上条码:

require(rgl)    
plot3d(xyz$x,xyz$y,xyz$z,type="l")

你们想要的是吗?

如何做到这一点? 它使用rgl.pop(),去除一个点和一条线,并将之作为线索——改变睡觉,控制速度:

ts <- function(xyz,sleep=0.3){
  plot3d(xyz,type="n")
  n = nrow(xyz)
  p = points3d(xyz[1,])
  l = lines3d(xyz[1,])
  for(i in 2:n){
    Sys.sleep(sleep)
    rgl.pop("shapes",p)
    rgl.pop("shapes",l)
    p=points3d(xyz[i,])
    l=lines3d(xyz[1:i,])
  }
}




相关问题
How to plot fitted model over observed time series

This is a really really simple question to which I seem to be entirely unable to get a solution. I would like to do a scatter plot of an observed time series in R, and over this I want to plot the ...

REvolution for R

since the latest Ubuntu release (karmic koala), I noticed that the internal R package advertises on start-up the REvolution package. It seems to be a library collection for high-performance matrix ...

R - capturing elements of R output into text files

I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...

R statistical package: wrapping GOFrame objects

I m trying to generate GOFrame objects to generate a gene ontology mapping in R for unsupported organisms (see http://www.bioconductor.org/packages/release/bioc/vignettes/GOstats/inst/doc/...

Changing the order of dodged bars in ggplot2 barplot

I have a dataframe df.all and I m plotting it in a bar plot with ggplot2 using the code below. I d like to make it so that the order of the dodged bars is flipped. That is, so that the bars labeled "...

Strange error when using sparse matrices and glmnet

I m getting a weird error when training a glmnet regression. invalid class "dgCMatrix" object: length(Dimnames[[2]]) must match Dim[2] It only happens occasionally, and perhaps only under larger ...

Generating non-duplicate combination pairs in R

Sorry for the non-descriptive title but I don t know whether there s a word for what I m trying to achieve. Let s assume that I have a list of names of different classes like c( 1 , 2 , 3 , 4 ) ...

Per panel smoothing in ggplot2

I m plotting a group of curves, using facet in ggplot2. I d like to have a smoother applied to plots where there are enough points to smooth, but not on plots with very few points. In particular I d ...

热门标签