[Rd] Colour Schemes
b.rowlingson at lancaster.ac.uk
Thu May 21 19:53:46 CEST 2009
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.... :)
More information about the R-devel