pylot的scatter函数制作散点图函数说明
来源:互联网 发布:广州数控车床编程图纸 编辑:程序博客网 时间:2024/06/06 20:47
matplotlib.pyplot.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, hold=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.Parameters:x, y : array_like, shape (n, )Input datas : scalar or array_like, shape (n, ), optionalsize in points^2. Default is rcParams['lines.markersize'] ** 2.c : color, sequence, or sequence of color, optional, default: ‘b’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’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: NoneA 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: NoneA 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: Nonevmin 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: NoneThe alpha blending value, between 0 (transparent) and 1 (opaque)linewidths : scalar or array_like, optional, default: NoneIf None, defaults to (lines.linewidth,).verts : sequence of (x, y), optionalIf 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: NoneIf 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 : PathCollectionOther Parameters: **kwargs : Collection properties
import matplotlib.pyplot as pltimport numpy as np# Fixing random state for reproducibilitynp.random.seed(19680801)N = 100r0 = 0.6x = 0.9 * np.random.rand(N)y = 0.9 * np.random.rand(N)area = np.pi * (10 * np.random.rand(N))**2 # 0 to 10 point radiic = np.sqrt(area)r = np.sqrt(x * x + y * y)area1 = np.ma.masked_where(r < r0, area)area2 = np.ma.masked_where(r >= r0, area)plt.scatter(x, y, s=area1, marker='^', c=c)plt.scatter(x, y, s=area2, marker='o', c=c)# Show the boundary between the regions:theta = np.arange(0, np.pi / 2, 0.01)plt.plot(r0 * np.cos(theta), r0 * np.sin(theta))plt.show()
阅读全文
0 0
- pylot的scatter函数制作散点图函数说明
- pylot.scatter 介绍
- Python之scatter散点图函数
- scatter函数绘制散点图——MATLAB
- matplotlib学习之scatter函数--绘制散点图
- python函数scatter使用
- Matplotlib中的scatter函数
- scatter函数参数详解
- 【机器学习】【可视化】Matplotlib的scatter函数用法
- 使用scatter与random.normal函数绘制散点图简单实例
- Python中scatter函数参数详解
- Python matplotlib库scatter函数参数详解
- python 中scatter()函数个参数意思
- bcmp函数的说明
- strtol函数的说明
- fseek()函数的说明
- __libc_start_main函数的说明
- strtol函数的说明
- 前端常用语句汇总
- apk反编译常见工具
- mysql 根据字段聚类并选出每组前N条
- IoC和DI的区别
- 解决组件化开发butterknife 在 library中使用的坑
- pylot的scatter函数制作散点图函数说明
- 输入一个网址并回车的时候都发生了什么 图解
- Matlab中video2img&img2video
- 布局动画 LayoutTransition
- spring 整合 quartz
- Linux查找占用的端口,并杀死进程
- 使用kubernetes访问外部服务(mysql\redis)
- WebSocket :记录WebSocket onError错误用法导致的BUG
- pc端自适应页面之新闻列表页