seaborn ) 한 개의 Figure에 여러 Axes 적용
FaceGrid() 행과 열에 데이터 별로 상관관계를 시각화해준다. import matplotlib.pyplot as plt import seaborn as sns # Seaborn 제공 데이터셋 가져오기 titanic = sns.load_dataset('titanic') # 스타일 테마 설정 (5가지: darkgrid, whitegrid, dark, white, ticks) sns.set_style('whitegrid') # 조건에 따라 그리드 나누기 g = sns.FacetGrid(data=titanic, col='who', row='survived',margin_titles=True) # 그래프 적용하기 g = g.map(plt.hist, 'age') pairplot() scatter, kde, h..
2022. 3. 30.
seaborn ) 막대 그래프
seaborn의 막대그래프는 기본적으로 오차범위를 계산하여 표시하여 준다. plt.figure(figsize=(5,4)) sns.barplot(x="sex",y="tip",data= tips) plt.show() 집단을 한 단계 더 나눠서 자세하게 시각화 할 수 있다. # 여러 열에서 집단 묶어서 세부 집단 시각화 하기 # hue 파라미터 추가 plt.figure(figsize=(6,4)) sns.barplot(x="sex",y="tip",hue="day", data=tips) plt.show() 오차막대가 보기 싫다면 ci=None # 오차막대 없애기 plt.figure(figsize=(6,4)) sns.barplot(x="sex",y="tip",hue="day", data=tips, ci=None) ..
2022. 3. 28.