Skip to content

[R ]Exporting rgl.snapshot and rgl.postscript

3 messages · Duncan Murdoch, Thanh Tran

#
Dear all,



I'm trying to plot a surface over the x-y plane. In my data, the response
is KIC, and 4 factors are AC, AV, T, and Temp. I want to have response
surface of KIC with two factors, i.e., AC and AV. A typical second-degree
response modeling is as follows:
+ data = data)
+ ylim = c(4, 7),  # The range for AV

+ xlab = "AC", ylab = "AV", zlab = "KIC",

+ col = "lightblue",

+ otherargs = list(Temp = 15, T = 40))
The problem is that the figure created by *rgl.snapshot* (attached Figure
1) has low quality, while the figure created by *rgl.postscript* (attached
Figure 2) doesn?t have adequate details.



Can somebody please show me how to properly export the file? I would prefer
the Figure have the TIFF or PDF with the resolution 600 dpi. I really
appreciate your support and help.



Best regards,

Nhat Tran



Ps: I also added a CSV file for practicing R.
#
On 27/11/2018 7:53 AM, Thanh Tran wrote:
You can improve the rgl.snapshot output by starting from a large window. 
  You can do this either by using the mouse to enlarge the window, or 
specifying values for windowRect in par3d() or open3d(), e.g.

open3d(windowRect=c(0,0, 1800, 1800))

Whether very large values will be respected depends on the system.  For 
example, my Macbook Air reduces that request so the whole window is visible,

 > par3d("windowRect")
[1]    0   45 1440  901

You can set the default to be a large window using

r3dDefaults <- getr3dDefaults()
r3dDefaults$windowRect <- c(0,0, 1800, 1800)

(This will only be respected by the *3d functions like open3d(), not the 
low-level rgl.* functions like rgl.open().)

The rgl.postscript() display is limited by what the GL2PS library can 
do, so if it doesn't do what you want, there's not much you can do to 
improve it.

Duncan Murdoch
#
Hi  Duncan Murdoch
Thank you for your support.
Best regards,
Nhat Tran

V?o Th 3, 27 thg 11, 2018 va?o lu?c 23:06 Duncan Murdoch <
murdoch.duncan at gmail.com> ?? vi?t: