Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.61.0508102002290.31620@gannet.stats>
Date: 2005-08-10T19:11:56Z
From: Brian Ripley
Subject: background colors in image()
In-Reply-To: <20050810183917.95610.qmail@web40808.mail.yahoo.com>

On Wed, 10 Aug 2005, someone needing to conceal his real name wrote:

> Hi, I am using image() function to plot a matrix which
> has some missing valuies (NA). It looks like, by
> default, missing values were drawn in white color, How
> can I change that into a different color, say a gray
> color? I tried to use bg='gray' argument with no luck.
> Anyone has a suggestion?

They are not drawn in white: in fact they are not drawn at all, so the 
current background (or if transparent, the canvas) is what you see.

> par(bg="yellow")
> image(matrix(c(1,2,NA, 1),2, 2))

works, for example.

-- 
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