MATLAB Function Reference Previous page   Next Page
scatter

Plot a Scatter (bubble) graph

Syntax

Description

scatter(X,Y,S,C) displays colored circles at the locations specified by the vectors X and Y (which must be the same size).

S determines the area of each marker (specified in points^2). S can be a vector the same length as X and Y or a scalar. If S is a scalar, MATLAB draws all the markers the same size. If S is empty, the default size is used.

C determines the colors of each marker. When C is a vector the same length as X and Y, 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).

scatter(X,Y) draws the markers in the default size and color.

scatter(X,Y,S) draws the markers at the specified sizes (S) with a single color. This type of graph is also known as a bubble plot.

scatter(...,markertype) uses the marker type specified instead of 'o' (see LineSpec for a list of marker specifiers).

scatter(...,'filled') fills the markers.

scatter(...,'PropertyName',propertyvalue) creates the scatter graph, applying the specified property settings. See scattergroup properties for a description of properties.

scatter(axes_handles,...) plots into the axes object with handle axes_handle instead of the current axes object (gca).

h = scatter(...) returns the handle of the scattergroup object created.

Backward Compatible Version

hpatch = scatter('v6',...) returns the handles to the patch objects created by scatter (see Patch Properties for a list of properties you can specify using the object handles and set).

See Plot Objects and Backward Compatibility for more information.

Examples

See Also

scatter3, plot3

Scatter/Bubble Plots for related functions

See Triangulation and Interpolation of Scatter Data for related information.

See Scattergroup Properties for property descriptions.


Previous page  savepath scatter3 Next page

© 1994-2005 The MathWorks, Inc.