未验证 提交 99f6922f 编写于 作者: 飞龙 提交者: GitHub

Merge pull request #31 from Yet-sun/master

translate 41-44
......@@ -4,51 +4,49 @@
class seaborn.JointGrid(x, y, data=None, height=6, ratio=5, space=0.2, dropna=True, xlim=None, ylim=None, size=None)
```
Grid for drawing a bivariate plot with marginal univariate plots.
用于绘制具有边际单变量图的双变量图的网格。
```py
__init__(x, y, data=None, height=6, ratio=5, space=0.2, dropna=True, xlim=None, ylim=None, size=None)
```
Set up the grid of subplots.
设置子图的网格。
参数:`x, y`strings or vectors
参数:`x, y`字符串或向量
> Data or names of variables in `data`.
> 在 `data`中的数据或变量名
`data`:DataFrame, optional
`data`:DataFrame, 可选
> DataFrame when `x` and `y` are variable names.
> 当 `x` and `y` 是变量名的时候为DataFrame。
`height`numeric
`height`数字
> Size of each side of the figure in inches (it will be square).
> 图中每一条边的大小(以英寸为单位)
`ratio`numeric
`ratio`数字
> Ratio of joint axes size to marginal axes height.
> 联合轴大小与边缘轴高度的比率。
`space`numeric, optional
`space`数字,可选
> Space between the joint and marginal axes
> 联合轴和边缘轴之间的空间
`dropna`:bool, optional
`dropna`:bool, 可选
> If True, remove observations that are missing from <cite>x</cite> and <cite>y</cite>.
> 如果为True,则删除 <cite>x</cite> 和 <cite>y</cite>中缺少的观察结果。
`{x, y}lim`two-tuples, optional
`{x, y}lim`二元组,可选
> Axis limits to set before plotting.
> 在绘图之前设置轴限制。
也可以看看
用于绘制具有多种不同默认绘图类型的双变量图的高级界面。
See also
例子:
High-level interface for drawing bivariate plots with several different default plot kinds.
Examples
Initialize the figure but don’t draw any plots onto it:
初始化图形,但不在其上绘制任何图形:
```py
>>> import seaborn as sns; sns.set(style="ticks", color_codes=True)
......@@ -59,7 +57,7 @@ Initialize the figure but don’t draw any plots onto it:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-1.png](img/a0e79dac9add2a97da1c95241a6122ab.jpg)
Add plots using default parameters:
使用默认参数添加绘图:
```py
>>> g = sns.JointGrid(x="total_bill", y="tip", data=tips)
......@@ -69,7 +67,7 @@ Add plots using default parameters:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-2.png](img/f984c858bd63441ea9761d632cb76d2c.jpg)
Draw the join and marginal plots separately, which allows finer-level control other parameters:
分别绘制联合分布图和边缘直方图,这可以以更精细的级别控制其他参数:
```py
>>> import matplotlib.pyplot as plt
......@@ -81,7 +79,7 @@ Draw the join and marginal plots separately, which allows finer-level control ot
![http://seaborn.pydata.org/_images/seaborn-JointGrid-3.png](img/3e159b4a38edb79ede76d93a55e2acb9.jpg)
Draw the two marginal plots separately:
分别绘制两个边缘直方图:
```py
>>> import numpy as np
......@@ -97,7 +95,7 @@ Draw the two marginal plots separately:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-4.png](img/1db698012d05626321ac93ffb7668a2c.jpg)
Add an annotation with a statistic summarizing the bivariate relationship:
添加注释,其中包含总结双变量关系的统计信息:
```py
>>> from scipy import stats
......@@ -111,7 +109,7 @@ Add an annotation with a statistic summarizing the bivariate relationship:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-5.png](img/fa99a0a13450712a4f2b13d983b1e766.jpg)
Use a custom function and formatting for the annotation
使用自定义的函数和注释格式
```py
>>> g = sns.JointGrid(x="total_bill", y="tip", data=tips)
......@@ -126,7 +124,7 @@ Use a custom function and formatting for the annotation
![http://seaborn.pydata.org/_images/seaborn-JointGrid-6.png](img/a8307f7ba7809b63c523168fde9e9379.jpg)
Remove the space between the joint and marginal axes:
移除联合轴和边缘轴之间的空间:
```py
>>> g = sns.JointGrid(x="total_bill", y="tip", data=tips, space=0)
......@@ -137,7 +135,7 @@ Remove the space between the joint and marginal axes:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-7.png](img/5beaabfceb79e2eef9563fc3044dd5f6.jpg)
Draw a smaller plot with relatively larger marginal axes:
绘制具有相对较大边缘轴的较小图:
```py
>>> g = sns.JointGrid(x="total_bill", y="tip", data=tips,
......@@ -149,7 +147,7 @@ Draw a smaller plot with relatively larger marginal axes:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-8.png](img/bfc4c60af4e09992569375d51943de88.jpg)
Set limits on the axes:
设置轴的限制:
```py
>>> g = sns.JointGrid(x="total_bill", y="tip", data=tips,
......@@ -161,12 +159,18 @@ Set limits on the axes:
![http://seaborn.pydata.org/_images/seaborn-JointGrid-9.png](img/3a85305cd59104b4d9403deb570373cc.jpg)
Methods
方法
[`__init__`](#seaborn.JointGrid.__init__ "seaborn.JointGrid.__init__")(x, y[, data, height, ratio, space, …]) | 设置子图的网格设置子图的网格。
`annotate`(func[, template, stat, loc]) | 用关于关系的统计数据来标注绘图。
[`plot`](seaborn.JointGrid.plot.html#seaborn.JointGrid.plot "seaborn.JointGrid.plot")(joint_func, marginal_func[, annot_func]) | 绘制完整绘图的快捷方式。
[`plot_joint`](seaborn.JointGrid.plot_joint.html#seaborn.JointGrid.plot_joint "seaborn.JointGrid.plot_joint")(func, **kwargs) | 绘制 <cite>x</cite><cite>y</cite>的双变量图。
[`plot_marginals`](seaborn.JointGrid.plot_marginals.html#seaborn.JointGrid.plot_marginals "seaborn.JointGrid.plot_marginals")(func, **kwargs) | 分别绘制 <cite>x</cite><cite>y</cite> 的单变量图。
`savefig`(*args, **kwargs) | 封装 figure.savefig 默认为紧边界框。
| [`__init__`](#seaborn.JointGrid.__init__ "seaborn.JointGrid.__init__")(x, y[, data, height, ratio, space, …]) | Set up the grid of subplots. |
| `annotate`(func[, template, stat, loc]) | Annotate the plot with a statistic about the relationship. |
| [`plot`](seaborn.JointGrid.plot.html#seaborn.JointGrid.plot "seaborn.JointGrid.plot")(joint_func, marginal_func[, annot_func]) | Shortcut to draw the full plot. |
| [`plot_joint`](seaborn.JointGrid.plot_joint.html#seaborn.JointGrid.plot_joint "seaborn.JointGrid.plot_joint")(func, **kwargs) | Draw a bivariate plot of <cite>x</cite> and <cite>y</cite>. |
| [`plot_marginals`](seaborn.JointGrid.plot_marginals.html#seaborn.JointGrid.plot_marginals "seaborn.JointGrid.plot_marginals")(func, **kwargs) | Draw univariate plots for <cite>x</cite> and <cite>y</cite> separately. |
| `savefig`(*args, **kwargs) | Wrap figure.savefig defaulting to tight bounding box. |
| `set_axis_labels`([xlabel, ylabel]) | Set the axis labels on the bivariate axes. |
\ No newline at end of file
`set_axis_labels`([xlabel, ylabel]) |在双变量轴上设置轴标签。
......@@ -4,16 +4,14 @@
JointGrid.plot(joint_func, marginal_func, annot_func=None)
```
Shortcut to draw the full plot.
绘制完整绘图的快捷方式。
Use <cite>plot_joint</cite> and <cite>plot_marginals</cite> directly for more control.
直接使用 <cite>plot_joint</cite><cite>plot_marginals</cite> 进行更多控制.
参数:**joint_func, marginal_func:callables**
参数:**joint_func, marginal_func:可调用**
> Functions to draw the bivariate and univariate plots.
> 绘制双变量和单变量图的函数。
返回值:`self`:JointGrid 实例
返回值:`self`:JointGrid instance
> Returns <cite>self</cite>.
> 返回 <cite>self</cite>.
......@@ -4,18 +4,16 @@
JointGrid.plot_joint(func, **kwargs)
```
Draw a bivariate plot of <cite>x</cite> and <cite>y</cite>.
绘制 <cite>x</cite> and <cite>y</cite>的双变量图。
参数:`func`plotting callable
参数:`func`可调用的绘图函数
> This must take two 1d arrays of data as the first two positional arguments, and it must plot on the “current” axes.
> 这必须将两个一维数据数组作为前两个位置参数,并且必须在“当前”轴上绘制。
`kwargs`key, value mappings
`kwargs`键,值映射
> Keyword argument are passed to the plotting function.
> 关键字参数传递给绘图函数。
返回值:`self`:JointGrid 实例
返回值:`self`:JointGrid instance
> Returns <cite>self</cite>.
> 返回 <cite>self</cite>.
......@@ -4,18 +4,16 @@
JointGrid.plot_marginals(func, **kwargs)
```
Draw univariate plots for <cite>x</cite> and <cite>y</cite> separately.
分别绘制 <cite>x</cite><cite>y</cite> 的单变量图。
参数:`func`plotting callable
参数:`func`可调用的绘图函数
> This must take a 1d array of data as the first positional argument, it must plot on the “current” axes, and it must accept a “vertical” keyword argument to orient the measure dimension of the plot vertically.
> 这必须将一维数据数组作为第一个位置参数,它必须在“当前”轴上绘图,并且它必须接受“垂直”关键字参数以垂直定向图的度量维度。
`kwargs`key, value mappings
`kwargs`键,值映射
> Keyword argument are passed to the plotting function.
> 关键字参数传递给绘图函数。
返回值:`self`:JointGrid 实例
返回值:`self`:JointGrid instance
> Returns <cite>self</cite>.
> 返回 <cite>self</cite>.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册