[Python] Seaborn - PairGrid, FacetGrid


[Python] Seaborn - PairGrid, FacetGrid

import matplotlib.pyplot as plt # matplotlib 불러오기 import seaborn as sns # seaborn 불러오기 %matplotlib inline # 그래프가 곧바로 프린트되도록 설정 iris = sns.load_dataset('iris') # iris라는 빌트인 데이터셋 이용할 것 tips = sns.load_dataset('tips') # tips라는 빌트인 데이터셋도 이용할 것 <PairGrid> PairGrid 는 데이터셋의 모든 변수들 간의 관계를 한 번에 보는 pairplot과 비슷한데, 조금 더 나아가 각 그래프 형식을 지정할 수 있다는 장점이 있다. g = sns.PairGrid(iris) # iris 데이터셋을 이용, PairGrid를 만들어서 g로 저장 g.map_diag(sns.distplot) # pairgrid의 대각선을 seaborn의 distplot (히스토그램)으로 설정 g.map_upper(plt.scatter...


#facetgrid #pairgrid #python #seaborn

원문링크 : [Python] Seaborn - PairGrid, FacetGrid