Draw a scatter plot with possibility of several semantic groupings.
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.
See the [tutorial](../tutorial/relational.html#relational-tutorial) for more information.
参数:`x, y`:names of variables in `data` or vector data, optional
> Input data variables; must be numeric. Can pass data directly or reference columns in `data`.
数据的不同子集的 x 和 y 之间的关系可以用 hue, size, style 这三个参数来控制绘图属性。
这些参数控制用于识别不同子集的视觉语义信息,三种语义类型全部使用的话可以独立显示三个维度,
但是这种风格的绘图很难解释或者说没大部分时候什么效果。使用过多的语义信息
(例如:对同一个变量同时使用 hue 和 style)对作图来说是很有帮助同时也更容易理解。
`hue`:name of variables in `data` or vector data, optional
阅读下面的教程可以 get 更多信息哦。
> Grouping variable that will produce points with different colors. Can be either categorical or numeric, although color mapping will behave differently in latter case.
**参数**:
`x, y`: data 或是向量 data 里面的变量名字,可选择
> 输入数据的变量,必须是数字,可以直接传递数据或引用数据中的列
`size`:name of variables in `data` or vector data, optional
`hue`: data 或是向量 data 里面的变量名字,可选择
> 将产生不同大小的点的变量进行分组,可以是类别也可以是数字,
但是大小映射在后一种情况会有不同的表现
> Grouping variable that will produce points with different sizes. Can be either categorical or numeric, although size mapping will behave differently in latter case.
`style`:name of variables in `data` or vector data, optional
> Grouping variable that will produce points with different markers. Can have a numeric dtype but will always be treated as categorical.
> Tidy (“long-form”) dataframe where each column is a variable and each row is an observation.
`palette`:palette name, list, or dict, 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.
> 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.
`hue_order`:列表,可选
> 对 hue 变量的级别的表象有特定的顺序,否则的话,顺序由 data 决定。当 hue 是数字的时候与它不相关
> 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.
> Specified order for appearance of the `size` variable levels, otherwise they are determined from the data. Not relevant when the `size` variable is numeric.
`style_order`:列表,可选
> 对于 style 变量级别表象的特定顺序,否则由 data 决定,当 style 是数字时不相关
`size_norm`:tuple or Normalize object, optional
> Normalization in data units for scaling plot objects when the `size` variable is numeric.
`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._
`{x,y}_bins`: 元组,矩阵或函数
> 暂时没有什么功能
`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._
> 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`:整型,可选
> 自举法的数量,用于计算区间的置信度,暂无功能
`n_boot`:int, optional
`alpha`:浮点型
> 设置点的不透明度
> Number of bootstraps to use for computing the confidence interval. _Currently non-functional._
> 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.