Thanh Tran
2018-11-27 12:53:38 UTC
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
+ xlab = "AC", ylab = "AV", zlab = "KIC",
+ col = "lightblue",
+ otherargs = list(Temp = 15, T = 40))
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.
______________________________________________
R-***@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
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
data<-read.csv("2.csv", header =T)
mod <- lm(KIC~AC+I(AC^2)+AV+I(AV^2)+T+I(T^2)+Temp+I(Temp^2)+AC:AV+AC:T+AC:Temp+AV:T+AV:Temp+T:Temp,
+ data = data)mod <- lm(KIC~AC+I(AC^2)+AV+I(AV^2)+T+I(T^2)+Temp+I(Temp^2)+AC:AV+AC:T+AC:Temp+AV:T+AV:Temp+T:Temp,
library(rgl)
KIC <- function(AC, AV, Temp, T) predict(mod, newdata = data.frame(AC, AV, Temp, T))
persp3d(KIC, xlim = c(4, 5), # The range of values for AC
+ ylim = c(4, 7), # The range for AVKIC <- function(AC, AV, Temp, T) predict(mod, newdata = data.frame(AC, AV, Temp, T))
persp3d(KIC, xlim = c(4, 5), # The range of values for AC
+ xlab = "AC", ylab = "AV", zlab = "KIC",
+ col = "lightblue",
+ otherargs = list(Temp = 15, T = 40))
rgl.snapshot("1.png", fmt = "png", top = TRUE )
rgl.postscript("1.pdf","pdf")
The problem is that the figure created by *rgl.snapshot* (attached Figurergl.postscript("1.pdf","pdf")
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.
______________________________________________
R-***@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.