Skip to content
Prev 44914 / 398532 Next

Help with multicolored points in one plot

On Thu, 26 Feb 2004, David Thibault wrote:

            
Concatenate the groups into a single x vector and y vector, together with
a vector of group identifiers (eg  1,1,1,1,1,2,2,2,2,2,2,2,3,3), then

plot(y~x, col=group)

or to get more control

prettycolors<- c("forestgreen","goldenrod","sienna")

plot(y~x, col=prettycolors[group])

There are examples in demo(graphics).

	-thomas