[R] gray background on jpegs using dev.print()

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Apr 1 18:54:05 CEST 2004


On Thu, 1 Apr 2004, John Muller wrote:

> When I try writing the current device to a jpeg file I keep getting a
> gray background for the jpeg images using dev.print.

That's because you are not using the correct tool.  dev.print is designed 
for printing, as it says.

> I have tried using the option bg="white" and bg="#FFFFFF"
> but neither seem to have any effect.

Where?  Is what you are copying on a transparent background (the default)?

> If instead of writing to a screen device I open a jpeg device I can get any background color
> I want.  This works, but I prefer to write to the screen and then 
> output to file if I like the results rather than to a file and have to view the jpegs
> to see results.
> 
> I am using R version 1.8.1 on Windows 2000.
> 
> Has anyone else had this problem?

What problem, exactly ...?  Please do read the posting guide and supply 
enough details for us to reproduce this.

And why if you are using Windows *are* you using dev.print when you are 
not printing and there are menus and savePlot to copy a plot to a jpeg 
file?


-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list