산점도 (Scatter Plot)
sns.scatterplot(x='mileage', y='price', data=df)
점의 크기 조절 (Bubble Plot)
size 인자를 사용하여 제3의 변수(예: year)를 점의 크기로 표현 가능.
sns.scatterplot(x='mileage', y='price', size='year', data=df)
추세선 추가 (lmplot)
sns.lmplot(x='mileage', y='price', data=df)
등고선 추가 (KDE Plot)
- 산점도 위에 밀도 등고선을 겹쳐 그려 분포를 더 명확히 파악.
sns.scatterplot(x='mileage', y='price', data=df)
sns.kdeplot(x='mileage', y='price', data=df, color='lightgray', alpha=0.5)
선 그래프 (Line Plot)
- 시간의 흐름에 따른 데이터 변화나 연속적인 추세를 시각화.
- 주요 인자:
hue: 해당 열에 따라 선의 색상을 구분.
estimator: y값 집계 방식 (기본값은 평균 mean, 표준편차 std 등 지정 가능).
sns.lineplot(data=df, x='year', y='price')
sns.lineplot(data=df, x='year', y='price', hue='model')
sns.lineplot(data=df, x='year', y='price', estimator='std')
막대 그래프와 카운트 플롯
막대 그래프 (Bar Plot)
- 범주형 변수에 따른 수치형 변수의 평균(또는 합계 등) 비교.
sns.barplot(data=df, x='model', y='price')
카운트 플롯 (Count Plot)
- 범주형 변수의 항목별 빈도(개수) 시각화.
- y축을 별도로 지정하지 않음 (개수를 자동으로 셈).
sns.countplot(data=df, x='model')