Learn R Programming

pcds (version 0.1.8)

plot.Lines3D: Plot a Lines3D object

Description

Plots the line together with the defining vectors (i.e., the initial and direction vectors).

Usage

# S3 method for Lines3D
plot(x, xlab = "x", ylab = "y", zlab = "z", phi = 40, theta = 40, ...)

Value

None

Arguments

x

Object of class Lines3D.

xlab, ylab, zlab

Titles for the \(x\), \(y\), and \(z\) axes, respectively (default is xlab="x", ylab="y" and zlab="z").

theta, phi

The angles defining the viewing direction. theta gives the azimuthal direction and phi the colatitude. See persp3D for more details.

...

Additional parameters for plot.

See Also

print.Lines3D, summary.Lines3D, and print.summary.Lines3D

Examples

Run this code
# \donttest{
P<-c(1,10,3); Q<-c(1,1,3);
vecs<-rbind(P,Q)
Line3D(P,Q,.1)
Line3D(P,Q,.1,dir.vec=FALSE)

tr<-range(vecs);
tf<-(tr[2]-tr[1])*.1
#how far to go at the lower and upper ends in the x-coordinate
tsq<-seq(-tf*10-tf,tf*10+tf,l=3) #try also l=10, 20 or 100

lnPQ3D<-Line3D(P,Q,tsq)
lnPQ3D
plot(lnPQ3D)
# }

Run the code above in your browser using DataLab