참고
https://seaborn.pydata.org/tutorial/regression.html
Estimating regression fits — seaborn 0.13.2 documentation
Estimating regression fits Many datasets contain multiple quantitative variables, and the goal of an analysis is often to relate those variables to each other. We previously discussed functions that can accomplish this by showing the joint distribution of
seaborn.pydata.org
seaborn을 진짜 안써서.. 많이 써봐야할텐데..
아무튼 오늘의 기록은 seaborn으로 시각화하여
두 데이터 간의 상관성을 보려고 한다.
import seaborn as sns #근데 왜 sns일까? 늘 궁금하다.
sns.regplot( #regplot을 사용해서 시각화
x=df['x축 컬럼명'],
y=df['y축 컬럼명'],
ci=None, #회귀선 주변 신뢰구간 설정. 나는 신뢰구간 없이 설정함
color="orange"
)
plt.title('그래프 제목')
plt.xlabel('x축의 제목')
plt.ylabel('y축의 제목')
plt.legend() #범례 표기
plt.grid(True) #눈금 설정
plt.show() #그래프 출력
'데이터사이언티스트로 살아남기 > 시각화' 카테고리의 다른 글
[시각화] 파이썬 Matplotlib 이중 축 그래프 만들기 (1) | 2024.11.20 |
---|