提交 17fa004b 编写于 作者: S Stuming

Update 22.md

上级 5f22e3a4
# seaborn.jointplot
> 译者:[Stuming](https://github.com/Stuming)
```py
seaborn.jointplot(x, y, data=None, kind='scatter', stat_func=None, color=None, height=6, ratio=5, space=0.2, dropna=True, xlim=None, ylim=None, joint_kws=None, marginal_kws=None, annot_kws=None, **kwargs)
```
Draw a plot of two variables with bivariate and univariate graphs.
绘制两个变量的双变量及单变量图。
This function provides a convenient interface to the [`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid") class, with several canned plot kinds. This is intended to be a fairly lightweight wrapper; if you need more flexibility, you should use [`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid") directly.
这个函数提供调用[`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid")类的便捷接口,以及一些封装好的绘图类型。这是一个轻量级的封装,如果需要更多的灵活性,应当直接使用[`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid").
参数:`x, y`:strings or vectors
参数:`x, y`:strings或者vectors
> Data or names of variables in `data`.
> `data`中的数据或者变量名。
`data`:DataFrame, optional
`data`:DataFrame, 可选
> DataFrame when `x` and `y` are variable names.
> 当`x`和`y`为变量名时的DataFrame.
`kind`:{ “scatter” | “reg” | “resid” | “kde” | “hex” }, optional
`kind`:{ “scatter” | “reg” | “resid” | “kde” | “hex” }, 可选
> Kind of plot to draw.
> 绘制图像的类型。
`stat_func`callable or None, optional
`stat_func`可调用的,或者None, 可选
> _Deprecated_
> 已过时
`color`:matplotlib color, optional
`color`:matplotlib颜色, 可选
> Color used for the plot elements.
> 用于绘制元素的颜色。
`height`:numeric, optional
`height`:numeric, 可选
> Size of the figure (it will be square).
> 图像的尺寸(方形)。
`ratio`:numeric, optional
`ratio`:numeric, 可选
> Ratio of joint axes height to marginal axes height.
> 中心轴的高度与侧边轴高度的比例
`space`:numeric, optional
`space`:numeric, 可选
> Space between the joint and marginal axes
> 中心和侧边轴的间隔大小
`dropna`:bool, optional
`dropna`:bool, 可选
> If True, remove observations that are missing from `x` and `y`.
> 如果为True, 移除`x`和`y`中的缺失值。
`{x, y}lim`:two-tuples, optional
`{x, y}lim`:two-tuples, 可选
> Axis limits to set before plotting.
> 绘制前设置轴的范围。
`{joint, marginal, annot}_kws`:dicts, optional
`{joint, marginal, annot}_kws`:dicts, 可选
> Additional keyword arguments for the plot components.
> 额外的关键字参数。
`kwargs`key, value pairings
`kwargs`键值对
> Additional keyword arguments are passed to the function used to draw the plot on the joint Axes, superseding items in the `joint_kws` dictionary.
> 额外的关键字参数会被传给绘制中心轴图像的函数,取代`joint_kws`字典中的项。
返回值:`grid`[`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid")
> [`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid") object with the plot on it.
> [`JointGrid`](seaborn.JointGrid.html#seaborn.JointGrid "seaborn.JointGrid")对象.
See also
参考
The Grid class used for drawing this plot. Use it directly if you need more flexibility.
绘制图像的Grid类。如果需要更多的灵活性,可以直接使用Grid类。
Examples
示例
Draw a scatterplot with marginal histograms:
绘制带有侧边直方图的散点图:
```py
>>> import numpy as np, pandas as pd; np.random.seed(0)
......@@ -81,7 +83,7 @@ Draw a scatterplot with marginal histograms:
![http://seaborn.pydata.org/_images/seaborn-jointplot-1.png](img/48d5020fcbaa6d2f36aae520f84a6234.jpg)
Add regression and kernel density fits:
添加回归线及核密度拟合:
```py
>>> g = sns.jointplot("total_bill", "tip", data=tips, kind="reg")
......@@ -90,7 +92,7 @@ Add regression and kernel density fits:
![http://seaborn.pydata.org/_images/seaborn-jointplot-2.png](img/8434c101b75c73a9e1b8dfb89975a2b5.jpg)
Replace the scatterplot with a joint histogram using hexagonal bins:
将散点图替换为六角形箱体图:
```py
>>> g = sns.jointplot("total_bill", "tip", data=tips, kind="hex")
......@@ -99,7 +101,7 @@ Replace the scatterplot with a joint histogram using hexagonal bins:
![http://seaborn.pydata.org/_images/seaborn-jointplot-3.png](img/6d5c569bf97b1f683a2ec921e1031112.jpg)
Replace the scatterplots and histograms with density estimates and align the marginal Axes tightly with the joint Axes:
将散点图和直方图替换为密度估计,并且将侧边轴与中心轴对齐:
```py
>>> iris = sns.load_dataset("iris")
......@@ -110,7 +112,7 @@ Replace the scatterplots and histograms with density estimates and align the mar
![http://seaborn.pydata.org/_images/seaborn-jointplot-4.png](img/c2c70e8889861b837b4fd45d707a6616.jpg)
Draw a scatterplot, then add a joint density estimate:
绘制散点图,添加中心密度估计:
```py
>>> g = (sns.jointplot("sepal_length", "sepal_width",
......@@ -121,7 +123,7 @@ Draw a scatterplot, then add a joint density estimate:
![http://seaborn.pydata.org/_images/seaborn-jointplot-5.png](img/b6895c87c4fa5a7fa1dc151dc3e5b385.jpg)
Pass vectors in directly without using Pandas, then name the axes:
不适用Pandas, 直接传输向量,随后给轴命名:
```py
>>> x, y = np.random.randn(2, 300)
......@@ -132,7 +134,7 @@ Pass vectors in directly without using Pandas, then name the axes:
![http://seaborn.pydata.org/_images/seaborn-jointplot-6.png](img/72b1f526c884ba4a6a285f1e8723013e.jpg)
Draw a smaller figure with more space devoted to the marginal plots:
绘制侧边图空间更大的图像:
```py
>>> g = sns.jointplot("total_bill", "tip", data=tips,
......@@ -142,7 +144,7 @@ Draw a smaller figure with more space devoted to the marginal plots:
![http://seaborn.pydata.org/_images/seaborn-jointplot-7.png](img/ddcf0a83320e56c75f2d5d15ff29c874.jpg)
Pass keyword arguments down to the underlying plots:
传递关键字参数给后续绘制函数:
```py
>>> g = sns.jointplot("petal_length", "sepal_length", data=iris,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册