matplotlib.pyplot.scatter — Matplotlib 3.1.2 documentation (original) (raw)
Parameters:
x, y : array_like, shape (n, )
The data positions.
s : scalar or array_like, shape (n, ), optional
The marker size in points**2. Default is rcParams['lines.markersize'] ** 2
.
c : color, sequence, or sequence of color, optional
The marker color. Possible values:
- A single color format string.
- A sequence of color specifications of length n.
- A sequence of n numbers to be mapped to colors using cmap and_norm_.
- A 2-D array in which the rows are RGB or RGBA.
Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. If you want to specify the same RGB or RGBA value for all points, use a 2-D array with a single row. Otherwise, value- matching will have precedence in case of a size matching with _x_and y.
Defaults to None
. In that case the marker color is determined by the value of color
, facecolor
or facecolors
. In case those are not specified or None
, the marker color is determined by the next color of the Axes
' current "shape and fill" color cycle. This cycle defaults to [rcParams["axes.prop_cycle"] = cycler('color', ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'])](../../tutorials/introductory/customizing.html?highlight=axes.prop%5Fcycle#a-sample-matplotlibrc-file)
.
marker : MarkerStyle, optional
The marker style. marker can be either an instance of the class or the text shorthand for a particular marker. Defaults to None
, in which case it takes the value of[rcParams["scatter.marker"] = 'o'](../../tutorials/introductory/customizing.html?highlight=scatter.marker#a-sample-matplotlibrc-file)
= 'o'. See markers for more information about marker styles.
cmap : Colormap, optional, default: None
A Colormap instance or registered colormap name. cmap is only used if c is an array of floats. If None
, defaults to rcimage.cmap
.
norm : Normalize, optional, default: None
A Normalize instance is used to scale luminance data to 0, 1.norm is only used if c is an array of floats. If None, use the default colors.Normalize.
vmin, vmax : scalar, optional, default: None
vmin and vmax are used in conjunction with norm to normalize luminance data. If None, the respective min and max of the color array is used. vmin and vmax are ignored if you pass a _norm_instance.
alpha : scalar, optional, default: None
The alpha blending value, between 0 (transparent) and 1 (opaque).
linewidths : scalar or array_like, optional, default: None
The linewidth of the marker edges. Note: The default _edgecolors_is 'face'. You may want to change this as well. If None, defaults to rcParams lines.linewidth
.
edgecolors : {'face', 'none', None} or color or sequence of color, optional.
The edge color of the marker. Possible values:
- 'face': The edge color will always be the same as the face color.
- 'none': No patch boundary will be drawn.
- A Matplotlib color or sequence of color.
Defaults to None
, in which case it takes the value of[rcParams["scatter.edgecolors"] = 'face'](../../tutorials/introductory/customizing.html?highlight=scatter.edgecolors#a-sample-matplotlibrc-file)
= 'face'.
For non-filled markers, the edgecolors kwarg is ignored and forced to 'face' internally.
plotnonfinite : boolean, optional, default: False
Set to plot points with nonfinite c, in conjunction withset_bad.
Other Parameters:
**kwargs : Collection properties