Skip to content
Prev 262654 / 398502 Next

persp and trans3d for type="h" points

You are drawing the line to the center of the plot (which is 0 be design).

What you actually want is to plot segments to the min(z) value.

Example:

Z <- matrix(1:9, 3)
surf <- persp(1:3, 1:3, Z)
points(trans3d(x=2, y=2, z=5, surf), col="red", pch=19)
from <- trans3d(x=2, y=2, z=5, surf)
to <- trans3d(x=2, y=2, z=min(Z), surf)
segments(from$x, from$y, to$x, to$y, col="red", lwd=2)

Uwe Ligges
On 13.06.2011 22:01, Tarmo Remmel wrote: