[R] generating graphical output when DISPLAY is not set?

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed May 1 08:31:16 CEST 2002


Peter Dalgaard has already given the correct answer: the png() driver *on
Unix* uses the Xserver to render the bitmap, and so you need one running.
That is on the help page.

This keeps on coming up ....  The problem (both in writing a png driver and
aesthetically) is the rendering of fonts.  For me bitmap() is an equally
good alternative, but other people don't like its output and so presumably
do not have gs working as well as mine (and I've been sent samples I don't
like which suggest that).

Ross once mentioned using (I think) OpenType fonts everywhere, which would
help solve this and the problems of copying bewteen devices (with
inevitably different font metrics).  I don't see that happening any time
soon.


On Tue, 30 Apr 2002, Petre Dimitrov wrote:

> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list