Draw a scatter plot with possibility of several semantic groupings.
数据的不同子集的x和y之间的关系可以用hue, size, style这三个参数来控制绘图属性。
这些参数控制用于识别不同子集的视觉语义信息,三种语义类型全部使用的话可以独立显示三个维度,
但是这种风格的绘图很难解释或者说没大部分时候什么效果。使用过多的语义信息
(例如:对同一个变量同时使用hue和style)对作图来说是很有帮助同时也更容易理解。
The relationship between `x` and `y` can be shown for different subsets of the data using the `hue`, `size`, and `style` parameters. These parameters control what visual semantics are used to identify the different subsets. It is possible to show up to three dimensions independently by using all three semantic types, but this style of plot can be hard to interpret and is often ineffective. Using redundant semantics (i.e. both `hue` and `style` for the same variable) can be helpful for making graphics more accessible.
阅读下面的教程可以get更多信息哦。
See the [tutorial](../tutorial/relational.html#relational-tutorial) for more information.
**参数**:
x ,y: data或是向量data里面的变量名字,可选择
>* 输入数据的变量,必须是数字,可以直接传递数据或引用数据中的列
参数:`x, y`:names of variables in `data` or vector data, optional
hue: data或是向量data里面的变量名字,可选择
>* 将产生不同大小的点的变量进行分组,可以是类别也可以是数字,
但是大小映射在后一种情况会有不同的表现
> Input data variables; must be numeric. Can pass data directly or reference columns in `data`.
style: data或是向量data里面的变量名字,可选择
>* 将产生不同标记的点的变量进行分类,可以有一个数字类型,但是这个数字会被当作类别
`hue`:name of variables in `data` or vector data, optional
> Grouping variable that will produce points with different colors. Can be either categorical or numeric, although color mapping will behave differently in latter case.
> Grouping variable that will produce points with different sizes. Can be either categorical or numeric, although size mapping will behave differently in latter case.
hue_norm: 元组或标准化的对象,可选
>* 当hue变量是数字的时候,应用于hue变量的色彩映射的数据单元中的标准化。如果是类别则不相关
`style`:name of variables in `data` or vector data, optional
> Colors to use for the different levels of the `hue` variable. Should be something that can be interpreted by [`color_palette()`](seaborn.color_palette.html#seaborn.color_palette "seaborn.color_palette"), or a dictionary mapping hue levels to matplotlib colors.
{x,y}_bins: 元组,矩阵或函数
>* 暂时没有什么功能
`hue_order`:list, optional
units: {long_form_var}
>* 分组特定的样本单元。使用时,将为每个具有适当的语义的单元绘制一根单独的线,
但不会添加任何图例条目。 当不需要确切的身份时,可用于显示实验重复的分布。
目前没啥作用
> Specified order for the appearance of the `hue` variable levels, otherwise they are determined from the data. Not relevant when the `hue` variable is numeric.
> Normalization in data units for colormap applied to the `hue` variable when it is numeric. Not relevant if it is categorical.
n_boot: 整型,可选
>* 自举法的数量,用于计算区间的置信度,暂无功能
`sizes`:list, dict, or tuple, optional
alpha: 浮点型
>* 设置点的不透明度
> An object that determines how sizes are chosen when `size` is used. It can always be a list of size values or a dict mapping levels of the `size` variable to sizes. When `size` is numeric, it can also be a tuple specifying the minimum and maximum size to use such that other values are normalized within this range.
{x,y}_jitter:布尔或者浮点型
>* 暂无功能
`size_order`:list, optional
legend:“brief”, “full”, or False, 可选
>* 绘制图例的方式。如果为“brief" 数字hue和size变量会代表一个样本,即便有不同的值
if "full", 每一个分组都有图例。if False 不绘制也不添加图例
> Specified order for appearance of the `size` variable levels, otherwise they are determined from the data. Not relevant when the `size` variable is numeric.
ax: matplotlib坐标轴,可选
>* 绘制图像的坐标对象,否则使用当前坐标轴
`size_norm`:tuple or Normalize object, optional
kwargs:键值映射对
>* 在绘制的时候其他的键会传递给plt.scatter
> Normalization in data units for scaling plot objects when the `size` variable is numeric.
返回值:ax:matplotlib 坐标轴
>* 返回绘制所需的坐标
`markers`:boolean, list, or dictionary, optional
请参阅官方文档
> Object determining how to draw the markers for different levels of the `style` variable. Setting to `True` will use default markers, or you can pass a list of markers or a dictionary mapping levels of the `style` variable to markers. Setting to `False` will draw marker-less lines. Markers are specified as in matplotlib.
用线显示两个变量之间的关系以强调连续性。绘制带有一个分类变量的散点图,排列点以显示值的分布。
`style_order`:list, optional
> Specified order for appearance of the `style` variable levels otherwise they are determined from the data. Not relevant when the `style` variable is numeric.
`{x,y}_bins`:lists or arrays or functions
> _Currently non-functional._
`units`:{long_form_var}
> Grouping variable identifying sampling units. When used, a separate line will be drawn for each unit with appropriate semantics, but no legend entry will be added. Useful for showing distribution of experimental replicates when exact identities are not needed.
>
> _Currently non-functional._
`estimator`:name of pandas method or callable or None, optional
> Method for aggregating across multiple observations of the `y` variable at the same `x` level. If `None`, all observations will be drawn. _Currently non-functional._
`ci`:int or “sd” or None, optional
> Size of the confidence interval to draw when aggregating with an estimator. “sd” means to draw the standard deviation of the data. Setting to `None` will skip bootstrapping. _Currently non-functional._
`n_boot`:int, optional
> Number of bootstraps to use for computing the confidence interval. _Currently non-functional._
`alpha`:float
> Proportional opacity of the points.
`{x,y}_jitter`:booleans or floats
> _Currently non-functional._
`legend`:“brief”, “full”, or False, optional
> How to draw the legend. If “brief”, numeric `hue` and `size` variables will be represented with a sample of evenly spaced values. If “full”, every group will get an entry in the legend. If `False`, no legend data is added and no legend is drawn.
`ax`:matplotlib Axes, optional
> Axes object to draw the plot onto, otherwise uses the current Axes.
`kwargs`:key, value mappings
> Other keyword arguments are passed down to `plt.scatter` at draw time.
返回值:`ax`:matplotlib Axes
> Returns the Axes object with the plot drawn onto it.
See also
Show the relationship between two variables connected with lines to emphasize continuity.Draw a scatter plot with one categorical variable, arranging the points to show the distribution of values.