728x90
산점도는 변수 간의 관계를 점으로 표현한 것이다. 변수 간의 상호 관계가 존재하지 않으면 랜덤하게 분포하는 모습을 보인다.
import matplotlib.pyplot as plt
import seaborn as sns
if __name__ == '__main__':
df = sns.load_dataset('iris')
print(df.head())
sns.regplot(x=df['sepal_length'], y=df['sepal_width'], fit_reg=False)
plt.show()
결과 값
sepal_length sepal_width petal_length petal_width species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
3 4.6 3.1 1.5 0.2 setosa
4 5.0 3.6 1.4 0.2 setosa
728x90
'Data Science > Data Visualization' 카테고리의 다른 글
[05. Etcetera Chart] 004. Bubble Chart (0) | 2021.09.06 |
---|---|
[05. Etcetera Chart] 003. Histogram (0) | 2021.09.06 |
[05. Etcetera Chart] 001. Box Plot (0) | 2021.09.06 |
[04. Area Chart] 005. Ridgeline Plot (0) | 2021.08.21 |
[04. Area Chart] 004. Stream Graph (0) | 2021.08.21 |