1. 目录 1. 目录 2 2. 绘图函数Plotting functions 4 2.1. 可视化的统计关系Visualizing statistical relationships 4 2.1.1. 用散点图联系变量Relating variables with scatter plots 4 2.1.2. 强调线条图的连续性Emphasizing continuity with line plots 10 2.1.3. 显示与切面的多个关系Showing multiple relationships with facets 21 2.2. 分类数据绘图Plotting with categorical data 24 2.2.1. 分类散点图Categorical scatterplots 26 2.2.2. 分类观测值分布Distributions of observations within categories 31 2.2.3. 分类统计估计Statistical estimation within categories 37 2.2.4. 对“wide-form”数据作图Plotting “wide-form” data 41 2.2.5. 显示与facet的多个关系Showing multiple relationships with facets 43 2.3. 可视化数据集的分布Visualizing the distribution of a dataset 44 2.3.1. 绘制单变量分布Plotting univariate distributions 45 2.3.2. 绘制二元分布Plotting bivariate distributions 51 2.3.3. 在数据集中可视化成对关系Visualizing pairwise relationships in a dataset 55 2.4. 可视化线性关系Visualizing linear relationships 57 2.4.1. 函数绘制线性模型Functions to draw linear regression models 58 2.4.2. 拟合不同种类的模型Fitting different kinds of models 61 2.4.3. 在其他变量上的情况Conditioning on other variables 68 2.4.4. 控制图表的大小和形状Controlling the size and shape of the plot 71 2.4.5. 在其他上下文中绘制回归图Plotting a regression in other contexts 73 3. 多图网格Multi-plot grids 76 3.1. 构建结构化的多图网格Building structured multi-plot grids 76 3.2. 有条件的小倍数Conditional small multiples 77 3.3. 使用定制函数Using custom functions 86 3.4. 绘制成对的数据关系Plotting pairwise data relationships 90 4. 绘图美学Plot aesthetics 99 4.1. 控制图表美学Controlling figure aesthetics 99 4.1.1. Seaborn图表风格Seaborn figure styles 101 4.1.2. 删除轴上的小凸起Removing axes spines 104 4.1.3. 临时设置图表样式Temporarily setting figure style 105 4.1.4. 覆盖Seaborn样式的元素Overriding elements of the seaborn styles 106 4.1.5. 缩放图表元素Scaling plot elements 108 4.2. 选择调色板Choosing color palettes 111 4.2.1. 创建颜色调色板Building color palettes 111 4.2.2. 定性调色板Qualitative color palettes 112 4.2.3. 连续调色板Sequential color palettes 116 4.2.4. 不同颜色的调色板Diverging color palettes 122 4.2.5. 设置默认调色板Setting the default color palette 124 5. 教程中的数据集 125 Seaborn是Python数据可视化库,它建立在matplotlib之上,为复杂的统计图形提供了一种更加高级和方便的接口。这个中文用户指南详细介绍了如何利用Seaborn进行各种类型的图表绘制,帮助用户更好地理解和呈现数据之间的关系。 在Seaborn中,`Plotting functions`主要分为几个部分: 1. **Visualizing statistical relationships**: - **Scatter plots**用于展示两个变量之间的关系,可以使用`scatterplot()`来创建。 - **Line plots**强调数据的连续性,例如通过`relplot()`或`lineplot()`函数绘制,可以用来展示时间序列数据的趋势。 - **Facets**是将数据分组并绘制多个子图的方法,例如使用`FacetGrid()`,可以展示不同条件下变量间的关系。 2. **Plotting with categorical data**: - **Categorical scatterplots**用于分类变量的散点图,可以用`catplot()`或`stripplot()`创建。 - **Distributions of observations within categories**展示类别内部的分布,如直方图或小提琴图,可使用`barplot()`, `boxplot()`, 或`violinplot()`。 - **Statistical estimation within categories**包括点估计和区间估计,如`pointplot()`, `bootstrapplot()`, 和`categorical_estimate()`。 - **Plotting “wide-form” data**适用于数据存储为多列分类变量的情况,可以转换数据格式后使用`catplot()`等函数。 - **Showing multiple relationships with facets**利用子图网格展示多个分类变量间的关系。 3. **Visualizing the distribution of a dataset**: - **Univariate distributions**可以使用`distplot()`、`kdeplot()`或`histplot()`来展示单变量的分布。 - **Bivariate distributions**如联合分布或边际分布,可以使用`jointplot()`或`pairplot()`。 - **Pairwise relationships in a dataset**可以使用`pairplot()`来查看数据集中所有变量之间的两两关系。 4. **Visualizing linear relationships**: - **Functions to draw linear regression models**如`regplot()`,可以绘制带有回归线的散点图。 - **Fitting different kinds of models**不仅限于简单线性回归,还可以处理多项式回归或其他模型。 - **Conditioning on other variables**允许在控制其他变量的情况下研究关系。 - **Controlling size and shape of the plot**可以调整图表的尺寸和比例,以便更好地可视化数据。 - **Plotting a regression in other contexts**如在条形图上或与其他类型图组合。 5. **Multi-plot grids**: - **Structured multi-plot grids**利用`GridSpec`和`SubplotSpec`创建自定义布局。 - **Conditional small multiples**在多个条件下展示相同图形,便于比较。 - **Using custom functions**可以自定义绘图函数,增强灵活性。 - **Plotting pairwise data relationships**使用`pairgrid()`创建成对的子图网格。 6. **Plot aesthetics**: - **Controlling figure aesthetics**包括调整图表的颜色、线条样式、字体等,如改变`style`和`context`。 - **Seaborn figure styles**预设了一些美观的风格,如`whitegrid`, `darkgrid`, `ticks`, 和`white`. - **Removing axes spines**可以移除轴的边框,使图表更简洁。 - **Temporarily setting figure style**可以在特定代码块内临时更改样式。 - **Overriding elements of the seaborn styles**可以单独修改样式元素。 - **Scaling plot elements**可以调整图例、标题、文本等的大小。 7. **Choosing color palettes**: - **Creating color palettes**可以自定义颜色列表。 - **Qualitative palettes**适合展示无序的类别数据。 - **Sequential palettes**用于表示连续数据的变化。 - **Diverging palettes**适合显示正负差异。 - **Setting the default color palette**可以全局设置Seaborn的颜色方案。 此外,教程中还提供了Seaborn自带的一些数据集,供学习者实践和探索。 Seaborn中文用户指南涵盖了从基本的统计关系可视化到复杂的数据分布和多图网格的全面内容,是深入理解数据可视化和使用Seaborn进行数据分析的强大资源。通过熟练掌握这些知识点,用户可以更有效地揭示数据背后的故事,进行科学的数据解释。




















剩余63页未读,继续阅读


- 粉丝: 1
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 学位论文-—基于51单片机的吉他调音器系统设计实物制作(1).doc
- 关于人工智能的发展及未来趋势探讨(1).docx
- 车床自动化设计加工--毕业设计论文(1).docx
- 5G通信技术对科技产业的影响与机遇(1).pptx
- 网站销售话术2012(2)(1).doc
- 软件工程PSP实践例程设计与验证开题报告(1).doc
- 互联网+背景下中小企业经营模式创新研究(1).docx
- 通信工程高风险作业施工安全操作指引设备类(1).doc
- 机电控制与可编程序控制器技术(1).docx
- Java架构师的岗位职责(1).docx
- 关于高校辅导员工作中互联网思维的应用分析(1).docx
- Excel-最基础应用于操作技巧讲课文档(1).ppt
- 计算机技术实习报告汇编7篇(1).doc
- 保险业信息化的财务集中管理方法分析(1).docx
- 地铁网络运营管理信息化系统建设的初探(1).docx
- 通过SQL企业管理器恢复数据库后在KIS商贸版中注册账套的方法(1).docx


