未验证 提交 26a674cc 编写于 作者: G GKcmdr 提交者: GitHub

Update 20.md

上级 72d08cab
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
seaborn.barplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, estimator=<function mean>, ci=95, n_boot=1000, units=None, orient=None, color=None, palette=None, saturation=0.75, errcolor='.26', errwidth=None, capsize=None, dodge=True, ax=None, **kwargs) seaborn.barplot(x=None, y=None, hue=None, data=None, order=None, hue_order=None, estimator=<function mean>, ci=95, n_boot=1000, units=None, orient=None, color=None, palette=None, saturation=0.75, errcolor='.26', errwidth=None, capsize=None, dodge=True, ax=None, **kwargs)
``` ```
Show point estimates and confidence intervals as rectangular bars. 条形图以矩形条的方式展示数据的点估值和置信区间
A bar plot represents an estimate of central tendency for a numeric variable with the height of each rectangle and provides some indication of the uncertainty around that estimate using error bars. Bar plots include 0 in the quantitative axis range, and they are a good choice when 0 is a meaningful value for the quantitative variable, and you want to make comparisons against it. 条形图表示每个矩形高度的数值变量的集中趋势的估计值,并提供使用误差条估计值周围不确定度的一些指示。A bar plot represents an estimate of central tendency for a numeric variable with the height of each rectangle and provides some indication of the uncertainty around that estimate using error bars. Bar plots include 0 in the quantitative axis range, and they are a good choice when 0 is a meaningful value for the quantitative variable, and you want to make comparisons against it.
For datasets where 0 is not a meaningful value, a point plot will allow you to focus on differences between levels of one or more categorical variables. For datasets where 0 is not a meaningful value, a point plot will allow you to focus on differences between levels of one or more categorical variables.
It is also important to keep in mind that a bar plot shows only the mean (or other estimator) value, but in many cases it may be more informative to show the distribution of values at each level of the categorical variables. In that case, other approaches such as a box or violin plot may be more appropriate. It is also important to keep in mind that a bar plot shows only the mean (or other estimator) value, but in many cases it may be more informative to show the distribution of values at each level of the categorical variables. In that case, other approaches such as a box or violin plot may be more appropriate.
Input data can be passed in a variety of formats, including: 输入数据的格式可以不同,包括:
* Vectors of data represented as lists, numpy arrays, or pandas Series objects passed directly to the `x`, `y`, and/or `hue` parameters. * Vectors of data represented as lists, numpy arrays, or pandas Series objects passed directly to the `x`, `y`, and/or `hue` parameters.
* A “long-form” DataFrame, in which case the `x`, `y`, and `hue` variables will determine how the data are plotted. * A “long-form” DataFrame, in which case the `x`, `y`, and `hue` variables will determine how the data are plotted.
...@@ -31,7 +31,7 @@ See the [tutorial](../tutorial/categorical.html#categorical-tutorial) for more i ...@@ -31,7 +31,7 @@ See the [tutorial](../tutorial/categorical.html#categorical-tutorial) for more i
**data** : DataFrame, array, or list of arrays, optional **data** : DataFrame, array, or list of arrays, optional
> Dataset for plotting. If `x` and `y` are absent, this is interpreted as wide-form. Otherwise it is expected to be long-form. > 用于绘图的数据集。如果缺失X值和Y值, this is interpreted as wide-form. Otherwise it is expected to be long-form.
**order, hue_order** : lists of strings, optional **order, hue_order** : lists of strings, optional
...@@ -59,7 +59,7 @@ See the [tutorial](../tutorial/categorical.html#categorical-tutorial) for more i ...@@ -59,7 +59,7 @@ See the [tutorial](../tutorial/categorical.html#categorical-tutorial) for more i
**color** : matplotlib color, optional **color** : matplotlib color, optional
> Color for all of the elements, or seed for a gradient palette. > 作用于所有元素的颜色,或者渐变色的种子。
**palette** : palette name, list, or dict, optional **palette** : palette name, list, or dict, optional
...@@ -206,7 +206,7 @@ Use `hue` without changing bar position or width: ...@@ -206,7 +206,7 @@ Use `hue` without changing bar position or width:
![http://seaborn.pydata.org/_images/seaborn-barplot-10.png](img/d38d4ad12b16322a5ed00690bcbcd8b6.jpg) ![http://seaborn.pydata.org/_images/seaborn-barplot-10.png](img/d38d4ad12b16322a5ed00690bcbcd8b6.jpg)
Plot all bars in a single color: 用同一种颜色绘制所有条柱:
```py ```py
>>> ax = sns.barplot("size", y="total_bill", data=tips, >>> ax = sns.barplot("size", y="total_bill", data=tips,
...@@ -237,4 +237,4 @@ Use [`catplot()`](seaborn.catplot.html#seaborn.catplot "seaborn.catplot") to com ...@@ -237,4 +237,4 @@ Use [`catplot()`](seaborn.catplot.html#seaborn.catplot "seaborn.catplot") to com
``` ```
![http://seaborn.pydata.org/_images/seaborn-barplot-13.png](img/a2d8b9c6867b1006b56e5508d5472c86.jpg) ![http://seaborn.pydata.org/_images/seaborn-barplot-13.png](img/a2d8b9c6867b1006b56e5508d5472c86.jpg)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册