Simon Cawley
2002-Apr-30 20:51 UTC
[R] generating graphical output when DISPLAY is not set?
Is it possible to generate graphical output (to a file) when the DISPLAY environment variable is not set? Here's the problem: $ unset DISPLAY $ R > png("foo.png") Error in X11(paste("png::", filename, sep = ""), width, height, pointsize, : unable to start device PNG In addition: Warning message: unable to open connection to X11 display`' I want to have a process running on a server call R to generate graphical output, and the problem is that I'm not guaranteed to have a valid DISPLAY set. I have some clumsy workarounds, but it would be cleaner if if I had some way to have R not require the DISPLAY. Thanks, -Simon -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2002-Apr-30 21:32 UTC
[R] generating graphical output when DISPLAY is not set?
Simon Cawley <simon_cawley at affymetrix.com> writes:> I want to have a process running on a server call R to generate graphical > output, and the problem is that I'm not guaranteed to have a valid > DISPLAY set. I have some clumsy workarounds, but it would be cleaner if > if I had some way to have R not require the DISPLAY.The png() driver takes its fonts from the X server pointed to by DISPLAY, so no-go. However: If you have ghostscript, you can use the bitmap() driver. (This *is* on the help page for png()!) -- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Don MacQueen
2002-Apr-30 22:43 UTC
[R] generating graphical output when DISPLAY is not set?
Having asked this question myself within the last 6 months or so, I think I can answer. The R png() driver relies on the png libraries, which come from another open-source project, not R. Those libraries require an active X11 display. Thus there is no within-R solution for the png() device without X11. There is, however, the bitmap() device (thanks to Prof. Ripley), which takes a different approach, and will produce png files without X11, provided you have ghostscript installed. In my experience, fonts rendered by ghostscript are not as good as fonts with the png(),X11 combination. Another approach might be to use the Xvfb "device", and see if you can't guarantee that it will always be running. -Don At 1:51 PM -0700 4/30/02, Simon Cawley wrote:>Is it possible to generate graphical output (to a file) when the >DISPLAY environment variable is not set? Here's the problem: > > $ unset DISPLAY > $ R > > png("foo.png") > Error in X11(paste("png::", filename, sep = ""), width, height, >pointsize, : > unable to start device PNG > In addition: Warning message: > unable to open connection to X11 display`' > >I want to have a process running on a server call R to generate graphical >output, and the problem is that I'm not guaranteed to have a valid >DISPLAY set. I have some clumsy workarounds, but it would be cleaner if >if I had some way to have R not require the DISPLAY. > >Thanks, > >-Simon > >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- >r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html >Send "info", "help", or "[un]subscribe" >(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch >_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-- -------------------------------------- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA -------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Petre Dimitrov
2002-May-01 00:09 UTC
[R] generating graphical output when DISPLAY is not set?
Do you have libpng installed properly on your machine? It seems R is not linked against that library. Check the output of ./configure or config.log whether the check for libpng was succesfull. If not, go to www.libpng.org/pub/png/libpng.html to download and install the relevant binary or source. Assuming you have Linux distro with rpm package management, you can download libpng-devel package from ftp.redhat.com or mirrors. Once R is linked against that library, look at the help for png() for the proper way to redirect the plotting to a file. Peter Dimitrov -----Original Message----- From: Simon Cawley [mailto:simon_cawley at affymetrix.com] Sent: Tuesday, April 30, 2002 1:51 PM To: r-help at stat.math.ethz.ch Subject: [R] generating graphical output when DISPLAY is not set? Is it possible to generate graphical output (to a file) when the DISPLAY environment variable is not set? Here's the problem: $ unset DISPLAY $ R > png("foo.png") Error in X11(paste("png::", filename, sep = ""), width, height, pointsize, : unable to start device PNG In addition: Warning message: unable to open connection to X11 display`' I want to have a process running on a server call R to generate graphical output, and the problem is that I'm not guaranteed to have a valid DISPLAY set. I have some clumsy workarounds, but it would be cleaner if if I had some way to have R not require the DISPLAY. Thanks, -Simon -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Petre Dimitrov
2002-May-01 01:01 UTC
[R] generating graphical output when DISPLAY is not set?
Do you have libpng installed properly on your machine? It seems R is not linked against that library. Check the output of ./configure or config.log whether the check for libpng was succesfull. If not, go to www.libpng.org/pub/png/libpng.html to download and install the relevant binary or source. Assuming you have Linux distro with rpm package management, you can download libpng-devel package from ftp.redhat.com or mirrors. Once R is linked against that library, look at the help for png() for the proper way to redirect the plotting to a file. Peter Dimitrov -----Original Message----- From: Simon Cawley [mailto:simon_cawley at affymetrix.com] Sent: Tuesday, April 30, 2002 1:51 PM To: r-help at stat.math.ethz.ch Subject: [R] generating graphical output when DISPLAY is not set? Is it possible to generate graphical output (to a file) when the DISPLAY environment variable is not set? Here's the problem: $ unset DISPLAY $ R > png("foo.png") Error in X11(paste("png::", filename, sep = ""), width, height, pointsize, : unable to start device PNG In addition: Warning message: unable to open connection to X11 display`' I want to have a process running on a server call R to generate graphical output, and the problem is that I'm not guaranteed to have a valid DISPLAY set. I have some clumsy workarounds, but it would be cleaner if if I had some way to have R not require the DISPLAY. Thanks, -Simon -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._