R gWidgets embeds "rgl" 3D graphics into gWidgets2 ggraphics device

Can I embed "rgl" 3D graphics in the gWidgets2 ggraphics device? For example,

library(gWidgets2)
library(rgl)

w <- gwindow("brushing example", visible=FALSE)
g <- ggroup(cont=w)
pg <- gnotebook(cont=g, expand=TRUE)
dev1 <- ggraphics(cont=pg)

visible(w) <- TRUE

visible(dev1) <- TRUE   
plot.new()  

x <- sort(rnorm(1000))
y <- rnorm(1000)
z <- rnorm(1000) + atan2(x,y)
plot3d(x, y, z, col=rainbow(1000))

      

Is it possible to place a 3D graph inside a gnotebook window?

+1


source to share





All Articles