Seaborn으로 시작하는 데이터 시각화
Content Team
DataCamp
관계형 플롯

관계형 플롯

관계형 플롯



scatterplot() 대신 relplot()을 사용하는 이유
relplot()으로 단일 그림에 서브플롯 생성 가능scatterplot() 사용
import seaborn as sns
import matplotlib.pyplot as plt
sns.scatterplot(x="total_bill",
y="tip",
data=tips)
plt.show()
relplot() 사용
import seaborn as sns
import matplotlib.pyplot as plt
sns.relplot(x="total_bill",
y="tip",
data=tips,
kind="scatter")
plt.show()
import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="smoker")plt.show()

import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", row="smoker")plt.show()

import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="smoker", row="time")plt.show()


import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="day", col_wrap=2)plt.show()

import seaborn as sns import matplotlib.pyplot as plt sns.relplot(x="total_bill", y="tip", data=tips, kind="scatter", col="day", col_wrap=2, col_order=["Thur", "Fri", "Sat", "Sun"])plt.show()

Seaborn으로 시작하는 데이터 시각화