未验证 提交 67560e2c 编写于 作者: G GKcmdr 提交者: GitHub

Update 20.md

上级 008959da
...@@ -15,13 +15,14 @@ seaborn.barplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, ...@@ -15,13 +15,14 @@ seaborn.barplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None,
输入数据的格式可以不同,包括: 输入数据的格式可以不同,包括:
* 以列表,numpy array或者pandas中的Series object 表示的向量。这些向量可以直接传入 `x`, `y`, 以及 `hue` 参数。 * 以列表,numpy array或者pandas中的Series object 表示的向量。这些向量可以直接传入 `x`, `y`, 以及 `hue` 参数。
* “long-form” DataFrame, 即x值,y值和色相变量决定了数据是如何绘制的。 * 长表, x值,y值和色相变量决定了数据是如何绘制的。
* “wide” DataFrame,每个列的数值都会被绘制出来. * 宽表,每个列的数值都会被绘制出来.
* 数组或者列表的向量。 * 数组或者列表的向量。
大多数情况下,您可以使用numpy的对象或者python的对象,但是用pandas对象更好,因为相关的but pandas objects are preferable because the associated names will be used to annotate the axes. 另外,为了控制绘图元素 您也可以可以用分类类型来组合不同的变量。 大多数情况下,您可以使用numpy的对象或者python的对象,但是用pandas对象更好,因为相关的but pandas objects are preferable because the associated names will be used to annotate the axes. 另外,为了控制绘图元素 您也可以可以用分类类型来组合不同的变量。
This function always treats one of the variables as categorical and draws data at ordinal positions (0, 1, … n) on the relevant axis, even when the data has a numeric or date type. 这个函数始终把一个变量当做分类变量,即使这个数据是数值类型或者日期类型,并且按照序数顺序绘制在相关的轴上。
详情请看[教程](../tutorial/categorical.html#categorical-tutorial) 详情请看[教程](../tutorial/categorical.html#categorical-tutorial)
...@@ -47,7 +48,7 @@ This function always treats one of the variables as categorical and draws data a ...@@ -47,7 +48,7 @@ This function always treats one of the variables as categorical and draws data a
**n_boot** : int, optional **n_boot** : int, optional
> Number of bootstrap iterations to use when computing confidence intervals. > 计算置信区间需要的Boostrap迭代次数。
**units** : name of variable in `data` or vector data, optional **units** : name of variable in `data` or vector data, optional
...@@ -75,7 +76,7 @@ This function always treats one of the variables as categorical and draws data a ...@@ -75,7 +76,7 @@ This function always treats one of the variables as categorical and draws data a
**errwidth** : float, optional **errwidth** : float, optional
> Thickness of error bar lines (and caps). > 错误条的线的厚度。
**capsize** : float, optional **capsize** : float, optional
...@@ -87,7 +88,7 @@ This function always treats one of the variables as categorical and draws data a ...@@ -87,7 +88,7 @@ This function always treats one of the variables as categorical and draws data a
**ax** : matplotlib Axes, optional **ax** : matplotlib Axes, optional
> Axes object to draw the plot onto, otherwise uses the current Axes. > 指定一个Axes用于绘图,如果不指定,则使用当前的Axes。
**kwargs** : key, value mappings **kwargs** : key, value mappings
...@@ -129,7 +130,7 @@ Draw a set of vertical bars with nested grouping by a two variables: ...@@ -129,7 +130,7 @@ Draw a set of vertical bars with nested grouping by a two variables:
![http://seaborn.pydata.org/_images/seaborn-barplot-2.png](img/863249efe2403afa4fae2f2b6884d3bd.jpg) ![http://seaborn.pydata.org/_images/seaborn-barplot-2.png](img/863249efe2403afa4fae2f2b6884d3bd.jpg)
Draw a set of horizontal bars: 绘制一组水平柱状图:
```py ```py
>>> ax = sns.barplot(x="tip", y="day", data=tips) >>> ax = sns.barplot(x="tip", y="day", data=tips)
...@@ -185,7 +186,7 @@ Add “caps” to the error bars: ...@@ -185,7 +186,7 @@ Add “caps” to the error bars:
![http://seaborn.pydata.org/_images/seaborn-barplot-8.png](img/5a69e1058d9b8b4b5be6dc15d1bad130.jpg) ![http://seaborn.pydata.org/_images/seaborn-barplot-8.png](img/5a69e1058d9b8b4b5be6dc15d1bad130.jpg)
使用一个不同的颜色条 使用一个不同的调色盘来绘制图案
```py ```py
>>> ax = sns.barplot("size", y="total_bill", data=tips, >>> ax = sns.barplot("size", y="total_bill", data=tips,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册