s-news
[Top] [All Lists]

Re: pdf.graph ignores my image colors

To: Kevin Wright <kwright@eskimo.com>
Subject: Re: pdf.graph ignores my image colors
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Mon, 27 Oct 2003 14:55:13 +0000 (GMT)
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <200310271435.GAA17482@eskimo.com>
The colours on a graphsheeet device (your `trellis image colors') are
only for that device.  They are nothing to do with colour schemes on any 
other device, such as pdf.graph.

On Mon, 27 Oct 2003, Kevin Wright wrote:

> 
> I'm using S-Plus 6.1 on Windows 2000.
> 
> I have set my trellis image colors to be a different palette 
> than the usual cyan->magenta.
> 
> When I use trellis.device to create a plot (on the video monitor)
> that uses image colors (like levelplot), my color settings are 
> honored.
> 
> When I use trellis.device(pdf.graph,...) to send the same graphic
> to a PDF file, my color settings are ignored and the default 
> cyan->magenta colors are used.
> 
> After way too much work, I have achieved a partial work-around:
> 
> 1. Used guiGetOption("ImageColorTableTrellis") to get the 
> rgb codes for my trellis image colors (three colors: red, 
> white, green).
> 
> 2. Go to R and use 'rainbow', 'col2rgb', etc.  Create a palette 
> of 100 colors.  Scale these to be in [0, 1].  
> Call this 'mycolormatrix'.
> 
> 3. Copy pdf.trellis.color=pdf.trellis.color
> 
> 4. Set: pdf.trellis.color$colormap[17:116,]=mycolormatrix
> 
> 5. Now call trellis.device(pdf.graph,...) and make the graphics.
> 
> My question is: Have I made this unnecessarily complicated?  
> Is there an easier way to make S-Plus honor the user's trellis 
> image colors?  At the very least, are there any S-Plus tools 
> for making a rainbow of 100 colors using the 
> ImageColorTableTrellis colors?
> 
> Kevin Wright
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news
> 
> 

-- 
Brian D. Ripley,                  ripley@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


<Prev in Thread] Current Thread [Next in Thread>