From edd@debian.org  Sun Nov 18 13:38:36 2001
From: edd@debian.org (Dirk Eddelbuettel)
Date: Sun, 18 Nov 2001 07:38:36 -0600
Subject: Producing PNG on Debian Linux (was the false bug report, Re: [Rd]
 png output requires X connection (PR#1165))
In-Reply-To: <Pine.GSO.4.31.0111180804410.6298-100000@auk.stats>
References: <20011118072343.A5075@progsoc.uts.edu.au>
 <Pine.GSO.4.31.0111180804410.6298-100000@auk.stats>
Message-ID: <15351.47580.969190.349929@sonny.eddelbuettel.com>


  "Brian" == Brian D Ripley <Prof> writes:
  Brian> On all my systems (Linux, Solaris, Windows)
  Brian> 
  >> bitmap("test.png") plot(1:10) graphics.off()
  Brian>  gives `sharp and clear' output.  I am using up-to-date GhostScript
  Brian> (7.00 or 6.51): perhaps *this* is the bug that needs to reported to
  Brian> Debian?
  Brian> 
  >> I agree it would be nice if the PNG output was not directly tied to the
  >> GUI but there are plenty of ways to get around the problem.
  Brian>  I seem to have to keep saying this!  PNG output is *not* `directly
  Brian> tied to the GUI'.  On Unix-alikes, one of the two devices I provided
  Brian> for you is, and only one.

How about clarifying the documenation in unix/png.Rd then?  A suggestion is
below (against my R-1.3.1 sources, don't have R-devel here).

Dirk

edd@sonny:~/debian> diff -u r-base-1.3.1/src/library/base/man/unix/png.Rd{.orig,}
--- r-base-1.3.1/src/library/base/man/unix/png.Rd.orig  Sun Nov 18 07:28:46 2001+++ r-base-1.3.1/src/library/base/man/unix/png.Rd       Sun Nov 18 07:33:55 2001@@ -47,6 +47,11 @@
   These are based on the \code{\link{X11}} device, so the additional
   arguments to that device work, but are rarely appropriate.  The
   colour handling will be that of the \code{X11} device in use.
+
+  Consequently, use of these functions requires an \code{X11} terminal
+  which is not available in non-interactive sessions such as those started
+  by cron(8) or at(1). The \code{\link{bitmap}} function can be used in
+  those cases to create PNG or JPEG files.
 }
 \author{Guido Masarotto and Brian Ripley}

@@ -59,5 +64,9 @@
 \examples{
 ## copy current plot to a PNG file
 \dontrun{dev.print(png, file="myplot.png", width=480, height=480)}
+## use bitmap() to create a PNG file
+\dontrun{bitmap("/tmp/test.png")}
+\dontrun{plot(1:10,main="Straight line")}
+\dontrun{graphics.off()}
 }
 \keyword{device}

-- 
Better to have an approximate answer to the right question 
than a precise answer to the wrong question. -- John Tukey
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


Producing PNG on Debian Linux (was the false bug report, Re: [Rd] png output requires X connection (PR#1165))
Dirk Eddelbuettel