Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rgl plot3d and snapshot3d: how do I save with resolution higher than my monitor?

Tags:

r

I am saving several plots, made with rgl's functions plot3d and snapshot3d. I need to save some at very high resolution, higher my screen. When I use

par3d("windowRect" = c(x,y,w,h))

to set the window dimension just before calling snapshot3d it works but the resolution is limited to my monitor's width or height. Is there a way to break this limit? Thank you all for your time.

like image 533
SteakOverflow Avatar asked Sep 28 '14 16:09

SteakOverflow


1 Answers

The solution I found to save in high resolution is to move away from the snapshot3d function and use rgl.postscript to save to a vector format like svg. This allows me to rasterize later with the resolution I want.

Example:

rgl.postscript("graph.svg", fmt="svg")

The function rgl.snapshot really grabs a snapshot from the device and I think there's no way to break screen's boundaries using this function unless, as Ben Bolker points out in the comments (thanks), a virtual frame buffer is used.

like image 88
SteakOverflow Avatar answered Oct 27 '22 05:10

SteakOverflow