For a book, I want to show two rgl images side-by-side, as in the image below. But the publisher wants images with at least 300 dpi resolution.
I created this using the code below to produce two separate images with rgl.snapshot()
and then combined them into a single image with some other software.
- How can I amend the code below to save each image with higher resolution? The images I get are ~ 256 x 256 pixels, I think with 72 dpi resolution.
Is there a different device driver I could use with
rgl.snapshot
?Is there some way to compose these into a single image using R?
data(randu)
# Figure 9.15 - 3D plots
library(rgl)
with(randu, plot3d(x, y, z, size=6, axes=FALSE,
xlab = "", ylab = "", zlab = ""))
box3d(col="gray")
# left panel
rgl.snapshot("randu0.png")
# right panel
rgl.viewpoint(theta = -3.8, phi = 3.8, fov = 0, zoom = 0.7)
rgl.snapshot("randu.png")