Seaborn 스타일 사용하기

Seaborn으로 배우는 중급 데이터 시각화

Chris Moffitt

Instructor

스타일 설정

  • Seaborn은 sns.set()으로 적용할 수 있는 기본 설정을 제공합니다
  • 이 스타일은 matplotlib 및 pandas 플롯에도 적용됩니다
sns.set()
df['Tuition'].plot.hist()

히스토그램 비교

Seaborn으로 배우는 중급 데이터 시각화

sns.set_style()의 테마 예시

for style in ['white','dark','whitegrid','darkgrid','ticks']:
    sns.set_style(style)
    sns.displot(df['Tuition'])
    plt.show()

수업료 플롯

Seaborn으로 배우는 중급 데이터 시각화

despine()으로 축 제거하기

  • 불필요한 요소를 제거하면 플롯이 개선되는 경우가 있습니다
  • Seaborn은 플롯의 테두리 선을 제거하는 단축 기능을 제공합니다
sns.set_style('white')
sns.displot(df['Tuition'])
sns.despine(left=True)

despine 예시

Seaborn으로 배우는 중급 데이터 시각화

연습해 봅시다!

Seaborn으로 배우는 중급 데이터 시각화

Preparing Video For Download...