Re: [R] colored 3d scatter plot

From: SNN <>
Date: Thu, 06 Mar 2008 15:14:56 -0800 (PST)

Thank you all for your help.

SNN wrote:
> Hi All,
> I have data for two groups, group with 100 points and group B with 15
> points. i needed plot these two groups in one scatter plot, each group
> with a different color. I tried
> plot3d(data, col = c("red", "blue")[c(rep(1, 100), rep(2, 15))], pch=20) .
> this works but the graph does not look good.
> the other option that I tried is
> scatterplot3d(data, type="p", highlight.3d=T, pch=16) where the graph
> looks much nicer but i do not know how to have each group with a different
> color.
> Does anyone know how to do it?
> Thanks

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 06 Mar 2008 - 23:50:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 07 Mar 2008 - 00:30:20 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive