matplotlib : axes.scatter
2017-12-20 16:35
330 查看
Axes.scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, verts=None, edgecolors=None, *, data=None, **kwargs)
Make a scatter plot of x vs y.
画散点图
Marker size is scaled by s and marker color is mapped to c.
标识符的大小由S决定,颜色由C决定
Parameters:
x, y : array_like, shape (n, )
这里的shape是(n,)
s : scalar or array_like, shape (n, ), optional
s:标量活数组,可选
c : color, sequence, or sequence of color, optional, default: ‘b’
c:颜色 默认蓝色,
c can be a single color format string, or a sequence of color specifications of length N, or a sequence of N numbers to be mapped to colors using the cmap and norm specified via kwargs (see below). 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. c can be a 2-D array in which the rows are RGB or RGBA, however, including the case of a single row to specify the same color for all points.
marker : MarkerStyle, optional, default: ‘o’
标志风格,可选,默认‘o’
See markers for more information on the different styles of markers scatter supports. marker can be either an instance of the class or the text shorthand for a particular marker.
cmap : Colormap, optional, default: None
颜色c的映射图,可选
A Colormap instance or registered name. cmap is only used if c is an array of floats. If None, defaults to rc image.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 normalize().
vmin, vmax : scalar, optional, default: None
vmin and vmax are used in conjunction with norm to normalize luminance data. If either are None, the min and max of the color array is used. Note if you pass a norm instance, your settings for vmin and vmax will be ignored.
alpha : scalar, optional, default: None
The alpha blending value, between 0 (transparent) and 1 (opaque)
linewidths : scalar or array_like, optional, default: None
If None, defaults to (lines.linewidth,).
verts : sequence of (x, y), optional
If marker is None, these vertices will be used to construct the marker. The center of the marker is located at (0,0) in normalized units. The overall marker is rescaled by s.
edgecolors : color or sequence of color, optional, default: None
If None, defaults to ‘face’
If ‘face’, the edge color will always be the same as the face color.
If it is ‘none’, the patch boundary will not be drawn.
For non-filled markers, the edgecolors kwarg is ignored and forced to ‘face’ internally.
Returns:
paths : PathCollection
Other Parameters:
**kwargs : Collection properties
See also
plot
to plot scatter plots when markers are identical in size and color
Notes
The plot function will be faster for scatterplots where markers don’t vary in size or color.
Any or all of x, y, s, and c may be masked arrays, in which case all masks will be combined and only unmasked points will be plotted.
Fundamentally, scatter works with 1-D arrays; x, y, s, and c may be input as 2-D arrays, but within scatter they will be flattened. The exception is c, which will be flattened only if its size matches the size of x and y.
Note
In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[]:
All arguments with the following names: ‘c’, ‘color’, ‘edgecolors’, ‘facecolor’, ‘facecolors’, ‘linewidths’, ‘s’, ‘x’, ‘y’.
相关文章推荐
- matplotlib Axes.scatter 函数学习笔记
- matplotlib scatter 散点图
- matplotlib中Axes的用法札记
- matplotlib基础——matplotlib.pyplot.scatter
- matplotlib命令与格式:设置栅格,axes脊柱(坐标轴),背景颜色
- matplotlib.scatter()
- matplotlib学习之scatter()函数--颜色印射
- matplotlib学习之scatter函数--绘制散点图
- matplotlib使用scatter画简单的散点图
- Python 中用 matplotlib 画散列点 (Scatter)
- matplotlib 的 subplot, axes and axis
- 【python】Matplotlib画图(一)——散点图scatter
- matplotlib.axes.Axes.plot
- scatter 基本用法 python matplotlib
- matplotlib tricks(一)—— 多类别数据的 scatter(cmap)
- matplotlib.axes.Axes.errorbar 误差bar图像
- pyqt5+matplotlib+Funcanimation+scatter(qt5+动态散点图)
- matplotlib获取鼠标所在位置的axes
- matplotlib命令与格式:图像(figure)与子区域(axes)布局与规划
- 使用matplotlib中的scatter绘图函数分析iris数据集中的特征属性