数据可视化(data visualization)—— seaborn
2016-01-03 11:24
417 查看
进入命令行界面(cmd)下载安装,
官当 doc:Seaborn: statistical data visualization
sns.set(style=’dark’, palette=’muted’, color_codes=True, font_scale=1.5)
sns.set_style(‘dark’)
主题 style:darkgrid, whitegrid, dark, white, ticks,默认为darkgrid。
sns.set_palette(‘muted’):柔和的;无言的;趋缓的
sns.set_context(‘notebook’, rc={‘lines.linewidth’:2.5})
sns.despine():
对于白底(
sns.despine(left=True):去掉左部的轴,也即 y 轴;
注意这条语句要放在 plot 的动作之后,才会起作用;
python科学计算数据可视化模块-seaborn
pip install seaborn。seaborn 是作为 matplotlib 的辅助工具才出现的,使其绘制出更为形象化的图形。
官当 doc:Seaborn: statistical data visualization
import seaborn as sns
sns.set(style=’dark’, palette=’muted’, color_codes=True, font_scale=1.5)
sns.set_style(‘dark’)
主题 style:darkgrid, whitegrid, dark, white, ticks,默认为darkgrid。
sns.set_palette(‘muted’):柔和的;无言的;趋缓的
sns.set_context(‘notebook’, rc={‘lines.linewidth’:2.5})
sns.despine():
对于白底(
white,
whitegrid)以及带刻度(
ticks)而言,顶部的轴是不需要的,默认为去掉顶部的轴;
sns.despine(left=True):去掉左部的轴,也即 y 轴;
注意这条语句要放在 plot 的动作之后,才会起作用;
1. palate(调色板)
palate = np.array(sns.color_palate('hls', 10)) # 10 行 3 列的调色板 # 也即 10 种 HLS 颜色
2. 实战:箱线图(box-plot)的绘制
sns.set_style('whitegrid') data = np.random.normal(size = (20, 6)) + np.arange(6)/2 sns.boxplot(data) sns.despine(left=True) plt.show()
3. 实战:正太分布拟合
x = np.random.normal(size=100) sns.distplot(x)
python科学计算数据可视化模块-seaborn
相关文章推荐
- c#下使用webdriver WebDriverWait不能正确控制超时的问题
- 工作流——顺序工作流
- 第四部分 关系映射
- 如何学习html画布呢(canvas)
- iOS之block
- mysql 用户
- c++ 内存管理
- 【转】oracle 创建create user 详解
- zoj3471&nefu1109游戏争霸赛【状态压缩】
- python 代码片段7
- PyCharm的注册与使用
- 安卓引导页面的练习
- leetcode之Populating Next Right Pointers in Each Node II
- CentOS 配置mysql允许远程登录
- python实战系列之生成随机验证码(三)
- Asp.net MVC中的ViewData与ViewBag
- delphi 获取串口列表
- 连接查询常用总结
- maven将jar导入本地maven库
- java入门PPT