From b.rowlingson at lancaster.ac.uk  Thu May 21 19:53:46 2009
From: b.rowlingson at lancaster.ac.uk (Barry Rowlingson)
Date: Thu, 21 May 2009 18:53:46 +0100
Subject: [Rd] Colour Schemes
In-Reply-To: <eb555e660905210929l13c59870v13c4e17cafa7f90f@mail.gmail.com>
References: <d8ad40b50905210444q406e1a2ak8313d495975d1919@mail.gmail.com>
	<OFDAD6BC3C.A2BA778D-ON802575BD.004783B8-802575BD.00491507@hsl.gov.uk>
	<d8ad40b50905210712k128ecfa2vff2dd178f946680d@mail.gmail.com>
	<eb555e660905210929l13c59870v13c4e17cafa7f90f@mail.gmail.com>
Message-ID: <d8ad40b50905211053p3ced543fy7bcc03d7ba19946a@mail.gmail.com>

On Thu, May 21, 2009 at 5:29 PM, Deepayan Sarkar
<deepayan.sarkar at gmail.com> wrote:

[oops I didnt reply-to-all]

> But you could specify an explicit 'at' vector specifying the color
> breakpoints: effectively, you want at = do.breaks(zlim, 5).
>
> lattice does have a function called 'level.colors' that factors out
> the color assignment computation.
>
 Yes, but these things are all at the wrong conceptual level. What you
are constructing here is a function that maps value to colour, but
keeping it as breaks and cut values and colours instead of
representing it as a function. Wouldn't it be nicer to build a real
function object and have that to pass around?

 ggplot uses a different approach, for example in
?scale_fill_gradient, but ggplot uses "+" to add the layer objects
together to create a plot. Nice. ggplot does things pretty well.
Perhaps if we scrap all the other graphics systems.... :)

Barry



[Rd] Colour Schemes
Barry Rowlingson