FUNCTION REFERENCE
plot3
3-D line plot.
3-D line plot.
Syntax
plot3(x, y, z)Syntax
plot3(x, y, z, style)Syntax
plot3(x1, y1, z1, x2, y2, z2, ...)Syntax
plot3(x, y, z, 'LineWidth', 2)Syntax
plot3(ax, ...)Syntax
h = plot3(...)Draws lines through the points (x, y, z). x, y and z are vectors of one length, or matrices of one size (one line per column), or vectors next to a matrix as plot allows. style and name-value pairs are those of plot. NaN in any coordinate breaks the line. Lines are clipped at the axes box: a segment outside XLim, YLim or ZLim is not drawn, and a segment crossing the box ends at the box face.
With hold off the axes switches to the 3-D view, view(3) = (-37.5, 30); with hold on the current view is kept. ZData of each line holds z.
Errors: "plot3: not enough input arguments; X, Y and Z are required", "plot3: X, Y and Z must be vectors of the same length", "plot3: X, Y and Z matrices must be the same size", "plot3: vector lengths must match the rows or columns of the X, Y and Z matrices", "plot3: data must be given as X, Y, Z triplets of real numeric arrays".
Example
t = 0:0.1:10; plot3(sin(t), cos(t), t) % a helixExample
h = plot3([1 2 3], [3 1 2], [0 1 0], 'r-o'); h.ZData % [0 1 0]Differences from MATLAB: Real coordinates only. The axes box is drawn as with box on (outline of the three back planes, plus the axis lines; box off keeps the axis lines only); no hidden-line removal for lines. zticks, zticklabels and camera properties are not supported yet; surfaces are drawn by surf and mesh.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.