Hi all,

I have tried to extract a figure in 3d using the snapshot3d function but the error is could not find function snapshot3d.

This is my code:

library(csn)

library(scatterplot3d) ;

library(mvtnorm);library(Matrix);library(csn);library(expm);

library(Perc);library(surface);library(rgl);library(MASS);

library(plot3D)

library(rgl)

set.seed(4321)

n<- 700

mu <- c(0,0)

sigma <- matrix(c(2,0.2,0.2,4),2)

gamma <- matrix(c(4,0,0,5),2)

nu <- c(-2,6)

delta <- matrix(c(1,0,0,1),2)

X1<- rcsn(n, mu, sigma, gamma, nu, delta)

t.kde <- kde2d(X1[,1], X1[,2], n = 50)

x <- seq(-5,5,length=n);y=x;

persp3d(x=t.kde,theta = 60, phi = 90, axes=TRUE,label=TRUE, nticks=5,col="blue")

#snapshot3d(file.path("C:/Users/the path of my desktop", "sim.png") , top = TRUE )

###########

Another way I did to extract the figure is this line

snapshot3d( "C:/Users/....", ..., scene, width = NULL, height = NULL,

webshot = rgl.useNULL())

snapshot3d(my script name, fmt = "png", top = TRUE)

but still in both ways I cannot extract this figure. Any idea please? Thank you.