[R] how to combine 2 3d scatterplots in R

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Feb 3 19:14:09 CET 2010



On 03.02.2010 18:38, mb622 wrote:
>
> hi,
>
> I am new to R and i have managed to create 2 3d scatterplots with R and
> Iwaswondering if there is a way to connect them.

In most cases it is advisable to just add points as shown in the 
examples of ?scatterplot3d

> I was also wondering how i can add arrows to the plot similar to the 2d
> comment arrows()?

Example:

## plot 10 points:
s3d <- scatterplot3d(1:10, 1:10, 1:10)

## plot arrows from (2,2,2) to (5,5,5)
## calculate arrow projections into 2D space:
from <- s3d$xyz.convert(2,2,2)
to <- s3d$xyz.convert(5,5,5)
## and plot:
arrows(from$x, from$y, to$x, to$y)


Uwe Ligges



More information about the R-help mailing list