R: plot 3d data



El vie, 21-12-2012 a las 08:20 +0000, Antonio Lapira escribi?:
> I found this way:
> 
> xc:[0,1,2,3,4,5]$
> yc:[2,3,0,1,6,7]$
> zc:[1,0,3,2,5,4]$
> draw3d(points(xc,yc,zc));
> 
> now the question is: how to add a label on each point that shows x,y,z coordinates without having to add labels manually like label(["0,2,1",0,2,2])
> is there a shortcut?
> 
> thanks

Hello,

You may try something like that:


draw_coord(x,y,z) :=
 block(
  [k: 1/2],
  draw3d(
   points(x,y,z),
   color = black,
   map(lambda([u,v,w],
              label([concat("(",u,",",v,",",w,")"),u,v,w+k])),
       x, y, z)))$

draw_coord(xc,yc,zc) $

--
Mario