Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 매틀랩
- Python
- MySQL
- 파이썬
- python visualization
- MATLAB
- Blog
- Google Analytics
- 딥러닝
- 서평
- Pandas
- 통계학
- 독후감
- Linux
- 파이썬 시각화
- Visualization
- Tistory
- 리눅스
- 텐서플로
- 한빛미디어
- 서평단
- 한빛미디어서평단
- 티스토리
- SQL
- 시각화
- 블로그
- tensorflow
- Ga
- 월간결산
- matplotlib
Archives
- Today
- Total
pbj0812의 코딩 일기
[PYTHON] displot, histplot 크기 조정하기 본문
0. 목표
- displot, histplot 크기 조정하기
1. 실습
1) library 호출
- figure size 미리 조정
* seaborn version update 필요 : pip install seaborn==0.11.1
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(rc={'figure.figsize':(15, 5)})
import pandas as pd
2) iris 데이터셋 로드
df = sns.load_dataset('iris')
3) distplot
- 없어질거라고 한다.
sns.distplot(df['sepal_length'])
4) histplot
- 크기가 잘 맞춰 나온다.
sns.histplot(df['sepal_length'])
5) displot
- 그림 크기가 마음대로 안 됨.
sns.displot(df['sepal_length'])
- Figure-level(displot), axes-level(histplot) 함수간의 차이로 인하여 그렇다고 함.
- displot 에서는 아래와 같이 옵션을 사용하여 크기 조정 가능
- height : 높이, aspect * height = width
sns.displot(df['sepal_length'], height = 5, aspect = 3)
2. 참고
'ComputerLanguage_Program > PYTHON' 카테고리의 다른 글
[PYTHON] transform 을 사용한 데이터 변환 (0) | 2021.07.01 |
---|---|
[PYTHON] pandas 로 UNION 구현하기 (0) | 2021.06.29 |
[PYTHON] subplots 를 이용한 y축이 두 개인 그래프(plotyy) 그리기 (0) | 2021.06.13 |
[PYTHON] HATCH 를 통한 bar 그래프에 문양 넣기 (0) | 2021.03.29 |
[Python] Pandas pivot, pivot_table 문서 따라하기 (0) | 2021.03.04 |
Comments