This table lists the long and short color name options and the equivalent RGB triplet values.
Alternatively, you can specify some common colors by name. The intensities must be in the range for example. 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.Īn RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. To plot multiple sets of coordinates on the same set of axes, specify at least one of x or y as a matrix. To plot one set of coordinates, specify x and y as vectors of equal length. To change the colormap for the axes, use the colormap function. scatter (x,y) creates a scatter plot with circular markers at the locations specified by the vectors x and y. The length of c 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 number of rows must equal the length of x and y. Each row of the matrix specifies an RGB triplet color for the corresponding marker. Three column matrix of RGB triplets - Use different colors for each marker. RGB triplet or color name - Plot all markers with the same color.