| MATLAB Function Reference | ![]() |
![]()
To graph selected variables, use the Plot Selector
in the Workspace Browser,
or use the Figure Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor. For details,
see Plotting Tools
— Interactive Plotting in the MATLAB® Graphics
documentation and Creating Graphics
from the Workspace Browser in the MATLAB Desktop Tools
documentation.
scatter3(X,Y,Z,S,C)
scatter3(X,Y,Z)
scatter3(X,Y,Z,S)
scatter3(...,markertype)
scatter3(...,'filled')
scatter3(...,'PropertyName',propertyvalue)
h = scatter3(...)
hpatch = scatter3('v6',...)
scatter3(X,Y,Z,S,C) displays colored circles at the locations specified by the vectors X, Y, and Z (which must all be the same size).
S determines the size of each marker (specified in points). S can be a vector the same length as X, Y, and Z or a scalar. If S is a scalar, MATLAB draws all the markers the same size.
C determines the colors of each marker. When C is a vector the same length as X, Y, and Z, the values in C are linearly mapped to the colors in the current colormap. When C is a length(X)-by-3 matrix, it specifies the colors of the markers as RGB values. C can also be a color string (see ColorSpec for a list of color string specifiers).
scatter3(X,Y,Z) draws the markers in the default size and color.
scatter3(X,Y,Z,S) draws markers at the specified sizes (S) in a single color.
scatter3(...,markertype) uses the marker type specified instead of 'o' (see LineSpec for a list of marker specifiers).
scatter3(...,'filled') fills the markers.
scatter3(...,'PropertyName',propertyvalue) creates the scatter graph, applying the specified property settings. See scattergroup properties for a description of properties.
h = scatter3(...) returns handles to the scattergroup objects created by scatter3. See Scattergroup Properties for property descriptions.
hpatch = scatter3('v6',...) returns the handles to the patch objects created by scatter3 (see Patch for a list of properties you can specify using the object handles and set).
Note The v6 option enables users of Version 7.x of MATLAB to create FIG-files that previous versions can open. It is obsolete and will be removed in a future version of MATLAB. |
See Plot Objects and Backward Compatibility for more information.
Use plot3 for single color, single marker size 3-D scatter plots.
[x,y,z] = sphere(16); X = [x(:)*.5 x(:)*.75 x(:)]; Y = [y(:)*.5 y(:)*.75 y(:)]; Z = [z(:)*.5 z(:)*.75 z(:)]; S = repmat([1 .75 .5]*10,prod(size(x)),1); C = repmat([1 2 3],prod(size(x)),1); scatter3(X(:),Y(:),Z(:),S(:),C(:),'filled'), view(-60,60)

See Scattergroup Properties for property descriptions
Scatter/Bubble Plots for related functions
![]() | scatter | Scattergroup Properties | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |