3-D Visualization Previous page   Next Page

Line Plots of 3-D Data

The 3-D analog of the plot function is plot3. If x, y, and z are three vectors of the same length,

generates a line in 3-D through the points whose coordinates are the elements of x, y, and z and then produces a 2-D projection of that line on the screen. For example, these statements produce a helix.

Plotting Matrix Data

If the arguments to plot3 are matrices of the same size, MATLAB plots lines obtained from the columns of X, Y, and Z. For example,

Notice how MATLAB cycles through line colors.


Previous page  A Typical 3-D Graph Representing a Matrix as a Surface Next page

© 1994-2005 The MathWorks, Inc.