Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenDocCN
seaborn-doc-zh
提交
003a1cb4
S
seaborn-doc-zh
项目概览
OpenDocCN
/
seaborn-doc-zh
8 个月 前同步成功
通知
1
Star
156
Fork
58
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
seaborn-doc-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
003a1cb4
编写于
7月 22, 2019
作者:
C
Cancan
提交者:
GitHub
7月 22, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix picture not shown problem
上级
757e6e07
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
10 deletion
+10
-10
docs/6.md
docs/6.md
+10
-10
未找到文件。
docs/6.md
浏览文件 @
003a1cb4
...
...
@@ -171,7 +171,7 @@ sns.residplot(x="x", y="y", data=anscombe.query("dataset == 'II'"),
sns
.
lmplot
(
x
=
"total_bill"
,
y
=
"tip"
,
hue
=
"smoker"
,
data
=
tips
);
```
![
http://seaborn.pydata.org/_images/regression_37_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/c1be6d813a335d32887cfd051ef9167f.jpg)
![
http://seaborn.pydata.org/_images/regression_37_0.png
](
img/c1be6d813a335d32887cfd051ef9167f.jpg
)
除了颜色之外,还可以使用不同的散点图标记来使绘图更好地再现为黑白。你还可以完全控制使用的颜色:
...
...
@@ -180,7 +180,7 @@ sns.lmplot(x="total_bill", y="tip", hue="smoker", data=tips,
markers
=
[
"o"
,
"x"
],
palette
=
"Set1"
);
```
![
http://seaborn.pydata.org/_images/regression_39_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/b065f9278c97b242c9a517aa98c090fa.jpg)
![
http://seaborn.pydata.org/_images/regression_39_0.png
](
img/b065f9278c97b242c9a517aa98c090fa.jpg
)
要添加另一个变量,你可以绘制多个"facet",其中每个级别的变量出现在网络的行或列中:
...
...
@@ -188,14 +188,14 @@ sns.lmplot(x="total_bill", y="tip", hue="smoker", data=tips,
sns
.
lmplot
(
x
=
"total_bill"
,
y
=
"tip"
,
hue
=
"smoker"
,
col
=
"time"
,
data
=
tips
);
```
![
http://seaborn.pydata.org/_images/regression_41_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/02113b4a6b876c8e3b32dd2bb7eae74c.jpg)
![
http://seaborn.pydata.org/_images/regression_41_0.png
](
img/02113b4a6b876c8e3b32dd2bb7eae74c.jpg
)
```
python
sns
.
lmplot
(
x
=
"total_bill"
,
y
=
"tip"
,
hue
=
"smoker"
,
col
=
"time"
,
row
=
"sex"
,
data
=
tips
);
```
![
http://seaborn.pydata.org/_images/regression_42_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/eb0843cd39205e7144eb4acdf1b8356d.jpg)
![
http://seaborn.pydata.org/_images/regression_42_0.png
](
img/eb0843cd39205e7144eb4acdf1b8356d.jpg
)
## 控制绘图的大小和形状
...
...
@@ -206,7 +206,7 @@ f, ax = plt.subplots(figsize=(5, 6))
sns
.
regplot
(
x
=
"total_bill"
,
y
=
"tip"
,
data
=
tips
,
ax
=
ax
);
```
![
http://seaborn.pydata.org/_images/regression_44_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/a94aa08c017f4688743921ccc9d8a4d0.jpg)
![
http://seaborn.pydata.org/_images/regression_44_0.png
](
img/a94aa08c017f4688743921ccc9d8a4d0.jpg
)
相比之下,
[
`lmplot()`
](
../generated/seaborn.lmplot.html#seaborn.lmplot
"seaborn.lmplot"
)
图的大小和形状是通过
[
`lmplot()`
](
http://typora-app/generated/seaborn.lmplot.html#seaborn.lmplot
)
接口,使用
`size`
和
`aspect`
参数控制,这些参数适用于绘图中的每个
`facet`
,而不是整个图形本身:
...
...
@@ -215,14 +215,14 @@ sns.lmplot(x="total_bill", y="tip", col="day", data=tips,
col_wrap
=
2
,
height
=
3
);
```
![
http://seaborn.pydata.org/_images/regression_46_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/fce6798715088ab4d9f615ae89a67b2c.jpg)
![
http://seaborn.pydata.org/_images/regression_46_0.png
](
img/fce6798715088ab4d9f615ae89a67b2c.jpg
)
```
python
sns
.
lmplot
(
x
=
"total_bill"
,
y
=
"tip"
,
col
=
"day"
,
data
=
tips
,
aspect
=
.
5
);
```
![
http://seaborn.pydata.org/_images/regression_47_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/ea6e78ca63d3d86dece589f475f2338d.jpg)
![
http://seaborn.pydata.org/_images/regression_47_0.png
](
img/ea6e78ca63d3d86dece589f475f2338d.jpg
)
## 在其他情境中绘制回归
...
...
@@ -232,7 +232,7 @@ sns.lmplot(x="total_bill", y="tip", col="day", data=tips,
sns
.
jointplot
(
x
=
"total_bill"
,
y
=
"tip"
,
data
=
tips
,
kind
=
"reg"
);
```
![
http://seaborn.pydata.org/_images/regression_49_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/0a3f41c0a016c66f0f3379c128f550b9.jpg)
![
http://seaborn.pydata.org/_images/regression_49_0.png
](
img/0a3f41c0a016c66f0f3379c128f550b9.jpg
)
使用
[
`pairplot()`
](
../generated/seaborn.pairplot.html#seaborn.pairplot
"seaborn.pairplot"
)
函数与
`kind="reg"`
将
[
`regplot()`
](
../generated/seaborn.regplot.html#seaborn.regplot
"seaborn.regplot"
)
和
[
`PairGrid`
](
../generated/seaborn.PairGrid.html#seaborn.PairGrid
"seaborn.PairGrid"
)
结合起来,来显示数据集中变量的线性关系。请注意这与
[
`lmplot()`
](
../generated/seaborn.lmplot.html#seaborn.lmplot
"seaborn.lmplot"
)
的不同之处。在下图中,两个轴在第三变量上的两个级别上没有显示相同的关系;相反,
[
`PairGrid()`
](
../generated/seaborn.PairGrid.html#seaborn.PairGrid
"seaborn.PairGrid"
)
用于显示数据集中变量的不同配对之间的多个关系。
...
...
@@ -241,7 +241,7 @@ sns.pairplot(tips, x_vars=["total_bill", "size"], y_vars=["tip"],
height
=
5
,
aspect
=
.
8
,
kind
=
"reg"
);
```
![
http://seaborn.pydata.org/_images/regression_51_0.png
](
/Users/huangcancan/Dropbox%20(Brown
)
/3_Private_Files/
img/65fcd97ee44e136d797a4d343a58cc4f.jpg)
![
http://seaborn.pydata.org/_images/regression_51_0.png
](
img/65fcd97ee44e136d797a4d343a58cc4f.jpg
)
像
[
`lmplot()`
](
../generated/seaborn.lmplot.html#seaborn.lmplot
"seaborn.lmplot"
)
,但不像
[
`jointplot()`
](
../generated/seaborn.jointplot.html#seaborn.jointplot
"seaborn.jointplot"
)
,额外的分类变量调节是通过
`hue`
参数内置在函数
[
`pairplot()`
](
../generated/seaborn.pairplot.html#seaborn.pairplot
"seaborn.pairplot"
)
中:
...
...
@@ -250,4 +250,4 @@ sns.pairplot(tips, x_vars=["total_bill", "size"], y_vars=["tip"],
hue
=
"smoker"
,
height
=
5
,
aspect
=
.
8
,
kind
=
"reg"
);
```
![
http://seaborn.pydata.org/_images/regression_53_0.png
](
)
\ No newline at end of file
![
http://seaborn.pydata.org/_images/regression_53_0.png
](
img/b166f746ed213b5ac4e495320f99b0fd.jpg
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录