If I change the background color of a plot, with par(bg="red") for example, I get a plot with a red background when I use the postscript or X11 devices. With the png or jpeg devices, the background is white. Is this the intended behavior, or a bug? Is there anyway to get a non-white background with the png device? I'm using R-1.1.0 on Linux. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Thu, 14 Sep 2000, Trent Piepho wrote:> If I change the background color of a plot, with par(bg="red") for example, I > get a plot with a red background when I use the postscript or X11 devices. > With the png or jpeg devices, the background is white. > > Is this the intended behavior, or a bug? Is there anyway to get a non-white > background with the png device? I'm using R-1.1.0 on Linux.A bit of both (as I never had a need for other than white backgrounds). But if people want it (evidently they do) it is a bug (Unix only as it seems correct on Windows). We will fix it in due course, but for now I believe that the bitmap device does pick up the background colour and can produce png or jpeg. -- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Fri, 15 Sep 2000, Prof Brian Ripley wrote:> On Fri, 15 Sep 2000, Prof Brian Ripley wrote: > > On Thu, 14 Sep 2000, Trent Piepho wrote: > > > If I change the background color of a plot, with par(bg="red") for example, I > > > get a plot with a red background when I use the postscript or X11 devices. > > Well, I don't in postscript, just invalid postscript (in 1.1.1 and > R-devel). The problem is that /fg must be set before /p2 is used, and > that is used to set the background colour via PS_Rect (and the problem > occurs in a couple of other places too).If I use the bitmap device, under R-1.1.0, I get a png file with the correct background color. I thought bitmap didn't work 1.1.0, but I'm not complaining.> (It's a one-line fix for png, but bitmap fails because postscript does. > In X11_NewPage, copy the line from the second section setting xd->bg > to the first section.)And after applying this fix, I get the proper background color with png() too. I'm trying to use R to generate dynamic content for web pages. I wanted to use the png device to avoid the overhead of the PS->png translation with ghostscript. However, since png requires an X server to generate the graphics, maybe that's a bad choice. I'd need to leave something like Xvfb running to provide a virtual X server on the web server. Yuck! -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._