plot3

Creates 3D lines in an axis and returns handles of the lines.

Syntax

h = plot3(x, y, z)

h = plot3(complex)

h = plot3(x, complex)

h = plot3(..., fmt)

h = plot3(..., property, value, ...)

h = plot3(hAxes, ...)

Inputs

x, y, z
Range of the x, y, and z axes.
Type: double | integer
Dimension: string | vector | matrix
complex
Complex matrix which real part is used as y data and imaginary part is used as z data
Type: complex
Dimension: matrix
fmt
Formatting string for the curve. It can be any combination of the following strings:
  1. line color: 'r', 'g', 'b', 'c', 'y', 'm', 'w', 'b'.
  2. marker style: 's', 'o', 'd', 'x', 'v', '^', '+', '*', '.'.
Note: Only the dash ('-') line style is supported for 3d curves.
Type: string
Dimension: scalar
property
Properties that control the appearance or behavior of the graphics object.
Type: string
Dimension: scalar
value
Value of the properties.
Type: double | integer | string
Dimension: scalar | vector
hAxes
Axis handle.
Type: double
Dimension: scalar

Outputs

h
Handle of the line graphics object.

Example

Simple plot3 example:

clf;
u = [0:(pi/50):(2*pi)];
x = sin(2*u).*(10.0 + 6*cos(3*u));
y = cos(2*u).*(10.0 + 6*cos(3*u));
z = 6*sin(3*u);
plot3(x,y,z)


Figure 1. Plot3 plot

Comments

If there is no axes, one is created first. Plot3 takes optional arguments to control the line style. It can be either a format string or property/value pair, or both. If a complex matrix is input, the real part is used for y coordinates and the imaginary part is used for z coordinates. If x is omitted, then the index of the columns of z is used for x coordinates. If the first argument of plot() is an axis handle, lines are created in that axis.