Search code examples
rrglplot3d

Is there a way to save an rgl 3D plot with high resolution?


I have a 3D plot from plot3d() function in rgl package, but the function rgl.postscript() is not working (the error message says it stopped working for my version of rgl - newest).

Is there any other way to save a frame of the 3D plot, and with high resolution (publication intent)?


Solution

  • If you have the Chrome browser installed, then install the webshot2 package and then rgl::snapshot3d() will take high quality images. For example, if you want 300 dpi resolution in a 3in x 3in plot, use

    snapshot3d(width = 900, height = 900)
    

    You may need to adjust line widths, etc., that doesn't happen automatically with snapshot3d().