Search code examples
rplotrgl

When open new rgl devices, the plot style is very different from the default one


When I use rgl package plot several 3d graphics in different canvas(rgl device) after using rgl.open() and set the bg as white, the plotting style seems so different from the default one. Is there a way to set this? Please see pics show below. When rotate those two graphs, very different experience you can get. You can try plot same graph in default canvas, open a new one and plot the same pic.

default plot canvasadded canvas

Besides, is there a way to change the outter box of the coordinate from a cube to a sphere?


Solution

  • (edit) Use open3d() instead of rgl.open() to open the new window. The documentation warns against mixing rgl.* calls with *3d calls, and I guess this is an example. Here are three plots -- default, rgl.open(), and open3d() ...

    library(rgl)
    plot3d(1:4,1:4,1:4)
    rgl.open()
    plot3d(1:4,1:4,1:4)
    open3d()
    plot3d(1:4,1:4,1:4)
    

    And the results side-by-side:

    enter image description here

    Session info:

    R Under development (unstable) (2012-12-14 r61321)
    Platform: i686-pc-linux-gnu (32-bit)
    [locale snipped]
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    other attached packages:
    [1] rgl_0.92.894