【第22期】观点:IT 行业加班,到底有没有价值?

Seaborn-PairGrid

原创 2016年05月31日 21:08:30

seaborn.pairplot

  • seaborn.pairplot(data, hue=None, hue_order=None, palette=None, vars=None, x_vars=None, y_vars=None, kind=’scatter’, diag_kind=’hist’, markers=None, size=2.5, aspect=1, dropna=True, plot_kws=None, diag_kws=None, grid_kws=None)

Parameters:

  • data : DataFrame
    Tidy (long-form) dataframe where each column is a variable and each row is an observation.
  • hue : (根据某一类别进行分类,比如code)string (variable name), optional
    Variable in data to map plot aspects to different colors.
  • hue_order : list of strings
    Order for the levels of the hue variable in the palette
  • palette : dict or seaborn color palette
    Set of colors for mapping the hue variable. If a dict, keys should be values in the hue variable.
  • vars : **DataFrame列名称**list of variable names, optional
    Variables within data to use, otherwise use every column with a numeric datatype.
    {x, y}_vars : lists of variable names, optional
    Variables within data to use separately for the rows and columns of the figure; i.e. to make a non-square plot.
    -* kind* : {‘scatter’, ‘reg’}, optional
    Kind of plot for the non-identity relationships.
  • diag_kind : (对脚线图形的种类){‘hist’, ‘kde’}, optional
    Kind of plot for the diagonal subplots.
  • markers : single matplotlib marker code or list, optional
    Either the marker to use for all datapoints or a list of markers with a length the same as the number of levels in the hue variable so that differently colored points will also have different scatterplot markers.
  • size : scalar, optional
    Height (in inches) of each facet.
  • aspect : scalar, optional
    Aspect * size gives the width (in inches) of each facet.
  • dropna : boolean, optional
    Drop missing values from the data before plotting.
    {plot, diag, grid}_kws : dicts, optional
    Dictionaries of keyword arguments.
%matplotlib inline
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
sns.set_style('darkgrid')
f,axes=plt.subplots(3,3,figsize=(9,9),sharex=True,sharey=True)

stock=pd.read_csv('sample.csv',index_col=0)
sns.kdeplot(stock.open,stock.high)
<matplotlib.axes._subplots.AxesSubplot at 0x3ad9e748>

sns.boxplot(stock.open,stock.high)
<matplotlib.axes._subplots.AxesSubplot at 0x277f22e8>

sns.lmplot(x='ma10',y='ma20',data=stock)
<seaborn.axisgrid.FacetGrid at 0x31245dd8>

sns.jointplot('ma10','price_change',data=stock,kind='reg')
<seaborn.axisgrid.JointGrid at 0x31c85898>

g=sns.pairplot(stock.ix[:,5:10])

sns.pairplot(stock.ix[:,10:],hue='code')
<seaborn.axisgrid.PairGrid at 0x5a860a20>

vars=['ma5','ma10','v_ma5']
sns.pairplot(stock,vars=vars,hue='code',size=5,kind='scatter',diag_kind='kde',diag_kws=dict(shade=True))
<seaborn.axisgrid.PairGrid at 0x6fc2ee10>

sns.pairplot(stock,vars=vars,hue='code',size=5,kind='scatter',plot_kws=dict(s=50, edgecolor="b", linewidth=1),diag_kind='kde',diag_kws=dict(shade=True))
<seaborn.axisgrid.PairGrid at 0x71608588>

版权声明:本文为博主原创文章,未经博主允许不得转载。 举报

相关文章推荐

初学pandas与seaborn(六)制作散…

散点矩阵图(也称SPLOM,或Scatterplot Matrix)用于粗略展现N列数据中,不同列之间的关系,可以粗略估计哪些变量是正相关的,哪些是负相关的,进而为下一步数据分析提供决策。许多统计语言...

Seaborn使用说明

python作图已成为数据分析中不可或缺的手段,常使用的包为matplotlib,它被很多其它包所依赖,例如pandas中具有的绘图功能就是对matplotlib的API的二次封装使用,今天要说明的s...

程序员升职加薪指南!还缺一个“证”!

CSDN出品,立即查看!

iris_visualization

import pandas as pd import warnings #ignore the warnings that generated by seaborn warnings.filter...

【scikit-learn】scikit-learn的线性回归模型

内容概要 如何使用pandas读入数据如何使用seaborn进行数据的可视化scikit-learn的线性回归模型和使用方法线性回归模型的评估测度特征选择的方法 ...

python3 matplotlib和seaborn的使用记录

matplotlib.pyplot使用记录

seaborn

%matplotlib inlineimport pandas as pd import numpy as np import seaborn as sns from sklearn import p...

Python数据可视化—seaborn简介和实例

Seaborn其实是在matplotlib的基础上进行了更高级的API封装,从而使得作图更加容易,在大多数情况下使用seaborn就能做出很具有吸引力的图。这里实例采用的数据集都是seaborn提供的...

Seaborn教程

原教程绘图风格管理控制图形审美 matplotlib是高度自定义的,但是很难去知道怎么调节参数获得一个很漂亮的plot,Seaborn库包含一些定制好的主题和一些高层次的参数去调节matplotl...

Seaborn绘图

Seaborn绘图 全部代码:https://github.com/lawlite19/Blog-Back-Up/blob/master/code/seaborn_study.py 个人博客地址:ht...

Python可视化seaborn练习题

seaborn —— 课后练✋%matplotlib inline import numpy as np import pandas as pd from scipy import stats, in...
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)