[R] text labels in 3d scatter

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Mar 6 19:32:39 CET 2006

> Hello,
> I am trying to draw a 3d scatter plot of the variables used in a
> multiple regresion (including the regression plane). I have had some
> luck with scatterplot3d; it fullfills those basic requirements. My
> problem though is that I also need to add the participant codes as a
> text-label to each point; after days of searching and reading, I
> cannot figure out how this is done. I would appreciate any advice that
> the community can offer.
> Thank you,
> John
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

See this example:

dat <- data.frame(x=1:10, y=1:10, z=1:10, label=letters[1:10])
s3d <- scatterplot3d(dat$x, dat$y, dat$z)
text(s3d$xyz.convert(dat$x, dat$y, dat$z), labels=dat$label, pos=1)

Uwe Ligges

More information about the R-help mailing list