Skip to content
Back to formatted view

Raw Message

Message-ID: <p05200f01bb06954be9cf@[128.40.218.142]>
Date: 2003-06-06T19:10:00Z
From: Frank
Subject: losing color in panal.xyplot (lattice)

Dear R help-list reader,

I have a grouping variable C<-c(1,2,3) which gives me the plot 
symbols in a xyplot (lattice library) in three different colors, 
according the group variable.

xyplot(A ~ B), group=factor(C))

if I now apply the panel.xyplot / panel.loess all the colors are 
changing back to red.

xyplot(A ~ B), group=factor(C)),
panel = function(x, y) {
            panel.grid(h=-1, v= 2)
            panel.xyplot(x, y)
            panel.loess(x,y, span=1)
        },
aspect = "xy")

I'm wondering if anyone knows a easy way how I could retain the 
colors of the plot symbols according to the grouping variable.

Yours
Frank
-- 
Frank Mattes, MD			e-mail:	f.mattes at ucl.ac.uk
Department of Virology			fax	0044(0)207 8302854
Royal Free Hospital and 			tel	0044(0)207 8302997
University College Medical School
London