Dear all, The following commands results in a blank graph file, postscript(file = "C:/Temp/Fig1.eps", height=4.0, width=4.0, horizontal = FALSE, onefile = FALSE, paper = "special") x11(height=3,width=3) par(mar=.1+c(4.5,4.5,0,0)) x <- c(10,20,30) y <- c(5, 7, 9) plot (x,y) dev.off() The codes function normally without any error in the command window. However, the resulting files (I tried .eps, .emf and .jpeg) are all too small in size (< 5 mb). The .jpeg file which one can normally preview in a Windows OS, says it's not available for preview when double clicked upon. I am using R version 2.0.0. Are there any changes to the coding in this version? Does anyone know how to fix this? Thank you in advance, Shiva ____________________ Sivakumar Mohandass, Department of Entomology, Kansas State University. [[alternative HTML version deleted]]
"Sivakumar Mohandass" <srivas at ksu.edu> writes:> Dear all, > > The following commands results in a blank graph file, > > postscript(file = "C:/Temp/Fig1.eps", height=4.0, width=4.0, > horizontal = FALSE, onefile = FALSE, paper = "special") > > x11(height=3,width=3) > par(mar=.1+c(4.5,4.5,0,0)) > > x <- c(10,20,30) > y <- c(5, 7, 9) > plot (x,y) > dev.off() > > The codes function normally without any error in the command window. > However, the resulting files (I tried .eps, .emf and .jpeg) are all too > small in size (< 5 mb). The .jpeg file which one can normally preview in a > Windows OS, says it's not available for preview when double clicked upon. > > I am using R version 2.0.0. Are there any changes to the coding in this > version? Does anyone know how to fix this?Get rid of the x11() command. Do you an explanation why, or was it left in accidentally? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Sivakumar Mohandass wrote:> Dear all, > > The following commands results in a blank graph file, > > postscript(file = "C:/Temp/Fig1.eps", height=4.0, width=4.0, > horizontal = FALSE, onefile = FALSE, paper = "special") > > x11(height=3,width=3) > par(mar=.1+c(4.5,4.5,0,0)) > > x <- c(10,20,30) > y <- c(5, 7, 9) > plot (x,y) > dev.off() >Your code above opens 2 devices (1=postscript, 2=x11) and only writes to the second. Thus nothing is ever written to nor do you ever close the first device. I think what you want is: postscript(file = "C:/Temp/Fig1.eps", height=4.0, width=4.0, horizontal = FALSE, onefile = FALSE, paper = "special") par(mar=.1+c(4.5,4.5,0,0)) x <- c(10,20,30) y <- c(5, 7, 9) plot (x,y) dev.off() The fact that you never closed the first device explains why you couldn't view it outside of R. --sundar> The codes function normally without any error in the command window. > However, the resulting files (I tried .eps, .emf and .jpeg) are all too > small in size (< 5 mb). The .jpeg file which one can normally preview in a > Windows OS, says it's not available for preview when double clicked upon. > > I am using R version 2.0.0. Are there any changes to the coding in this > version? Does anyone know how to fix this? > > Thank you in advance, > Shiva