plot3

Creates 3D lines in an axes 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 for the following strings:
  1. line style: '-', '-.', ':', '--".
  2. line color: 'r', 'g', 'b', 'c', 'y', 'm', 'w', 'b'.
  3. marker style: 's', 'o', 'd', 'x', 'v', '^', '+', '*', '.'.
Type: string
Dimension: scalar
property
Properties that control the appearance or behavior of the graphics object .
Type: string
Dimension: scalar
value
Value of 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 will be created first. Plot3 takes optional arguments to control the line style. It can be either a format string or property/value pair(s), 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 axes handle, lines will be created in that axes.