Re: [R] Transparent backgrounds in png files

From: Prof Brian Ripley <>
Date: Thu 29 Jul 2004 - 17:38:23 EST

The bitmap() device does not support transparency. The png() device does.

On Thu, 29 Jul 2004, Patrick Connolly wrote:

> The result I'm aiming to achieve is a bitmap that can be imported into
> a PowerPoint file that shows what's behind the lines of the plot.
> There's a way in PowerPoint that almost works. By choosing a colour
> to set as transparent, what is behind the graphic is indeed visible,
> but it's at the expense of losing line and text definition.
> I notice there have been discussions about transparent backgrounds
> mostly with lattice plots. The problem most people seem to have was
> getting a blue background when they wanted a white one.
> Mine is the reverse (and I'm using standard graphics, not Lattice).
> I'm trying to get a transparent background but it always comes out
> white. Setting bg = "transparent", I've tried using a bitmap device
> to create a png file. I've also tried creating a postscript file and
> converting it to a PNG file using the Gimp. I've always used a
> resolution of 300 dpi in bitmaps since the default is far too low.

Really? You want PNG files of 2000+ pixels in each dimension? (The standard size of an R plot is 7", and at 72dpi that is a reasonable size for on-screen use -- and you should not really be using bitmapped files for other uses.)

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Thu Jul 29 17:48:51 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 02:41:14 EST