[R] scatterplot3d

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Oct 20 16:09:44 CEST 2002

Luis Miguel Almeida da Silva wrote:
> Hello!
> I have a 38x3 matrix and I would like to make a 3d plot.
> However the first 27 rows are from one class and the others are
> from other class. My target is to plot the two classes with
> different colors in the same 3d plot. Is it possible? I have
> already package scatterplot3d.

Yes, just specify a vector containing the colours (either by names or
numbers). Example:

  X <- matrix(rnorm(3*38), ncol = 3)
  scatterplot3d(X, type = "h", 
    color = rep(c("black", "red"), c(27, 11)))

Uwe Ligges
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list