plot3

Purpose

Plot points and lines in 3-space.

Synopsis

plot3(X,Y,Z)
plot3(X,Y,Z,'linetype')
plot3(X1,Y1,Z1,'linetype1',X2,Y2,Z2,'linetype2',...)
h = plot3(...)

Description

plot3 is a three-dimensional analogue of plot.

plot3(X,Y,Z), where X, Y, and Z are three vectors of the same length, plots a line in three-space through the points whose coordinates are the elements of X, Y and Z. If X, Y, and Z are three matrices of the same size, plot3 plots several lines obtained from the columns of X, Y, and Z.

Various line types, plot symbols and colors can be obtained with plot3(X,Y,Z,s) where s is a 1, 2, or 3 character string made from the characters listed under the plot command.

plot3(x1,y1,z1,s1,x2,y2,z2,s2,x3,y3,z3,s3,...) combines the plots defined by the (x,y,z,s) fourtuples, where the x's, y's, and z's are vectors or matrices and the s's are strings.

h = plot3(...) returns a column vector of handles to line objects, one handle per line. The line objects created by plot3 are children of the current axes.

The x,y,z triples, or x,y,z,s quads can be followed by parameter value pairs to specify additional properties of the lines.

Examples

Plot a three-dimensional helix:

t = 0:pi/50:10*pi;
plot3(sin(t),cos(t),t)
          

(c) Copyright 1994 by The MathWorks, Inc.