Yu, Xuesong <xyu <at> scharp.org> writes: > I am trying to use xyplot to plot several lines in one panel with red > color for a group of lines, say 3 lines and blue color for another > group of lines, say 4. I know this can be easily done using regular > plot function. But i could not figure out how to do this in xyplot. >
states <- data.frame(state.x77, state.name = dimnames(state.x77)[[1]], state.region = state.region) xyplot(Murder ~ Population, data = states, groups = state.region, col.line=c("red","red","green","green"), panel = panel.superpose, panel.groups = panel.loess) # Note the difference when colors are recycled xyplot(Murder ~ Population, data = states, groups = state.region, col.line=c("red","green"), panel = panel.superpose, panel.groups = panel.loess) Dieter ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.