Save the orientation of a RGL plot3d() plot

后端 未结 1 1256
不思量自难忘°
不思量自难忘° 2020-12-24 06:52

I have a 3D plot using RGL. I would like to make identical plots using color to highlight the distribution of some variable. To do this I would like to have identical plots,

相关标签:
1条回答
  • 2020-12-24 07:24

    Ben's comment basically answers your question; this just applies expand.dots to what he wrote ;)

    ## In an inital session:
    
    library(rgl)
    plot3d(iris) 
    
    ## Now move the image around to an orientation you like
    
    ## Save RGL parameters to a list object
    pp <- par3d(no.readonly=TRUE)
    
    ## Save the list to a text file
    dput(pp, file="irisView.R", control = "all")
    
    .......
    
    ## Then, in a later session, to recreate the plot just as you had it:
    
    library(rgl)
    pp <- dget("irisView.R")
    plot3d(iris)
    par3d(pp)
    
    0 讨论(0)
提交回复
热议问题