Skip to content
Prev 199583 / 398506 Next

How to change color the default in levelplot() ?

Here is an example of how I do it using the 'col.regions' parameter:

# create color palette
col.l <- colorRampPalette(c('blue', 'green', 'purple', 'yellow', 'red'))(30)

levelplot(aisle ~ store * pog, storePOG, col.regions=col.l,
    cuts=diff(range(as.numeric(as.character(storePOG$aisle)), na.rm=TRUE)),
    scales=list(x=list(rot=90, cex=0.5)),
    panel=function(x, y, subscripts, ...){
        panel.levelplot(x, y, subscripts, ...)
        ltext(x,y,storePOG$lr[subscripts], fontface="bold", cex=.6)
    },
    xlab="Store", ylab="Planogram", main="Physical Aisle Locations")
On Sun, Nov 8, 2009 at 10:15 PM, BabyL BabyK <babyl.babyk at yahoo.com> wrote: