scatter3

Creates 3D dots in an axes and returns handles of the dots.

Syntax

h = scatter3(x, y, z)

h = scatter3(..., color)

h = scatter3(..., style)

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

h = scatter3(hAxes, ...)

Inputs

x, y, z
Range of the x, y, and z axes.
Type: double | integer
Dimension: scalar | vector | matrix
color
Color of the scattered dots.
Type: double | integer
Dimension: scalar
style
Style of the scattered dots.
Type: double | integer
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 scatter graphics object.

Examples

Simple scatter3 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);
scatter3(x, y, z)``````
Simple scatter3 example with options:
``````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);

p=scatter3(x,y,z)
get(p)
set(p, 'marker', 'v')
set(p, 'markerfacecolor', [255 5 5])``````