Description

scatter(x,y,sz) specifies
the circle sizes. To plot each circle with equal size, specify sz as
a scalar. To plot each circle with a different size, specify sz as
a vector with length equal to the length of x and y.

scatter(x,y,sz,c) specifies
the circle colors. To plot all circles with the same color, specify c as
a color name or an RGB triplet. To use varying color, specify c as
a vector or a three-column matrix of RGB triplets.

Modify Scatter Series After Creation

Use s to query and set properties of the scatter series after it has been created. Set the line width to 0.6 point. Set the marker edge color to blue. Set the marker face color using an RGB triplet color.

Note: Starting in R2014b, you can use dot notation to set properties. If you are using an earlier release, use the set function instead, such as set(s,'LineWidth',0.6).

Three column matrix of RGB triplets — Use
different colors for each marker. Each row of the matrix specifies
an RGB triplet color for the corresponding marker. The number of rows
must equal the length of x and y.

Vector — Use different colors for each marker
and linearly map values in c to the colors in the
current colormap. The length of c must equal the
length of x and y. To change
the colormap for the axes, use the colormap function.

If you have three points in the scatter plot and want the colors
to be indices into the colormap, specify c as a
three-element column vector.

An RGB triplet is a three-element row vector whose elements
specify the intensities of the red, green, and blue components of the color. The intensities
must be in the range [0,1]; for example, [0.4 0.6 0.7].
Alternatively, you can specify some common colors by name. This table lists the long and short
color name options and the equivalent RGB triplet values.

Option

Description

Equivalent RGB Triplet

'red' or 'r'

Red

[1 0 0]

'green' or 'g'

Green

[0 1 0]

'blue' or 'b'

Blue

[0 0 1]

'yellow' or 'y'

Yellow

[1 1 0]

'magenta' or 'm'

Magenta

[1 0 1]

'cyan' or 'c'

Cyan

[0 1 1]

'white' or 'w'

White

[1 1 1]

'black' or 'k'

Black

[0 0 0]

Example: 'k'

Example: [1
2 3 4]

mkr — Marker type'o' (default) | '+' | '*' | '.' | 'x' | ...

Marker type, specified as one of the values listed in this
table.

Value

Description

'o'

Circle

'+'

Plus sign

'*'

Asterisk

'.'

Point

'x'

Cross

'square' or 's'

Square

'diamond' or 'd'

Diamond

'^'

Upward-pointing triangle

'v'

Downward-pointing triangle

'>'

Right-pointing triangle

'<'

Left-pointing triangle

'pentagram' or 'p'

Five-pointed star (pentagram)

'hexagram' or 'h'

Six-pointed star (hexagram)

'none'

No markers

'filled' — Option to fill interior of markers'filled'

Option to fill the interior of the markers, specified as 'filled'.
Use this option with markers that have a face, for example, 'o' or 'square'.
Markers that do not have a face and contain only edges do not draw
('+', '*', '.',
and 'x').

The 'filled' option sets the MarkerFaceColor property
of the Scatter object to 'flat' and
the MarkerEdgeColor property to 'none',
so the marker faces draw, but the edges do not.

ax — Target axesAxes object | PolarAxes object

Target axes, specified as an Axes object or a
PolarAxes object. If you do not specify the axes and
if the current axes are Cartesian axes, then the scatter
function uses the current axes. To plot into polar axes, specify the
PolarAxes object as the first input argument or use
the polarscatter function.

Name-Value Pair Arguments

Specify optional
comma-separated pairs of Name,Value arguments. Name is
the argument name and Value is the corresponding value.
Name must appear inside single quotes (' '). You can
specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN.

Example: 'MarkerFaceColor','red' sets the
marker face color to red.

The Scatter object properties listed here are
only a subset. For a complete list, see Scatter Properties.

Marker outline color, specified 'flat', an RGB triplet, or one of the color
options listed in the table. The default value of 'flat' uses colors
from the CData property.

For a custom color, specify an RGB triplet. An RGB triplet is a
three-element row vector whose elements specify the intensities of the red, green, and blue
components of the color. The intensities must be in the range [0,1]; for
example, [0.4 0.6 0.7]. Alternatively, you can specify some common colors by
name. This table lists the long and short color name options and the equivalent RGB triplet
values.

For a custom color, specify an RGB triplet. An RGB triplet is a
three-element row vector whose elements specify the intensities of the red, green, and blue
components of the color. The intensities must be in the range [0,1]; for
example, [0.4 0.6 0.7]. Alternatively, you can specify some common colors by
name. This table lists the long and short color name options and the equivalent RGB triplet
values.

'LineWidth' — Width of marker edge0.5 (default) | positive value

Output Arguments

s — Scatter objectScatter object

Scatter object. Use s to
access and modify properties of the scatter chart after it has been
created.

Extended Capabilities

Tall ArraysCalculate with arrays that have more rows than fit in memory.

Usage notes and limitations:

Supported syntaxes for tall arrays X and Y
are:

scatter(X,Y)

scatter(X,Y,sz)

scatter(X,Y,sz,c)

scatter(___,'filled')

scatter(___,mkr)

scatter(___,Name,Value)

scatter(ax,___)

sz must be scalar or empty [].

c must be scalar or an RGB triplet.

Categorical inputs are not supported.

With tall arrays, the scatter function plots in iterations, progressively adding to the plot as more data is read. During the updates, a progress indicator shows the proportion of data that has been plotted. Zooming and panning is supported during the updating process, before the plot is complete. To stop the update process, press the pause button in the progress indicator.