Seaborn数据可视化用到的API

Seaborn数据可视化用到的API

Seaborn是基于MatploLib的可视化工具。它提供了丰富的接口,对统计数据做可视化。

1、Object Interface(对象接口)

接口名称接口说明所属类型
Plot声明统计图形的类型Plot Object
Dot适用于点图或者密度较低的散点图Mark Object
Dots点标记,可指定绘图标记的大小Mark Object
Line连接数据点按照轴向排列的标记Line Marks
Lines用于绘制多条线,灵活度较差Line Marks
Path按照点出现的顺序连接数据点Line Marks
Paths与Path相比,连接更快,但是灵活性较差Line Marks
Range在最大或者最小值之间绘制的定向标记线Line Marks
Bar在基线和数据点之间绘制的条形标记,适合绘制条形图Bar Marks
Bars适合直方图的条形标记Bar Marks
Areas基线到数据点之间的填充标记,适合绘制面积图Fill Marks
Band值之间的间隔填充,适合绘制带阴影的折线图Fill Marks
Continuous支持规范和数字转换Scale Object
Nominal不具有量纲的分类尺度Scale Object
Temporal时间分类尺度Scale Object

2、Function interface(功能接口)

接口名称接口说明所属类型
Relplot在FaceGrid上绘制关系图的图形界面,通过kind参数可以指定图形的类型。例如scatter、line等Relational Plots
Scatterplot绘制存在多个维度数据的散点图Relational Plots
Lineplot绘制存在多个维度数据的折线图Relational Plots
Displot在FaceGrid上绘制分布点的图形界面,默认绘制条形图。可通过参数修改图形类型Distribution Plots
Histplot绘制单变量或者多变量的直方图,展示数据的分布Distribution Plots
Catplot在FaceGrid上绘制分类图的图形界面,默认为散点图。可通过kind参数指定图形Categorical Plots
Boxplot以箱图展示数据分布Categorical Plots
Boxenplot以增强的箱图为较大的数据集会图Categorical Plots
Pointplot点估计并用点来标记误差Categorical Plots
Barplot将点估计和误差显示为条形图Categorical Plots
Countplot使用条形图展示每个分类的观察数Categorical Plots
Lmplot绘制数据和回归模型,可绘制多条回归线Regression Plots
Regplot绘制数据和线性回归模型的拟合Regression Plots
Heatmap绘制热力图Matric Plots
Clustermap绘制带聚类图的热力图Matric Plots

3、Multi-plot Grid(多窗口绘图)

接口名称接口说明接口类型
FacetGrid绘制条件关系的多图网格,不会显示图形。类似于subplotFacet Grids
Pairplot在数据集中绘制成对关系Pair Grids
PairGrid带网格的子图

4、Themeing(主题设置)

接口名称接口解释可设置选项
Set_theme设置图形显示的视觉效果背景、显示风格、字体
Axes_style设置轴的显示,对全局效果的局部调整
Set_style设置图形显示的基本格式,全局效果
Plotting_context控制绘图元素缩放的参数轴、标签的大小
Reset_defaults将Rc参数恢复到默认参数

5、Utility function (实用功能)

接口名称接口解释
move_legend在新的位置创建图例
Load_dataset从在线数据库加载数据
get_dataset_names得到可用的数据集,对发现数据加载的问题的有用
get_data_home得到数据下载的路径
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值