250x250
Link
๋์ GitHub Contribution ๊ทธ๋ํ
Loading data ...
Notice
Recent Posts
Recent Comments
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- ๊ตฐ์งํ
- ์ธ๋์ํ๋ง
- ADsP
- ๋ฐ์ดํฐ๋ถ์์ค์ ๋ฌธ๊ฐ
- t-test
- ํฌ๋กค๋ง
- ํ์ด์ฌ
- LDA
- PCA
- ๋ฐ์ดํฐ๋ถ๊ท ํ
- pandas
- datascience
- ๋ ๋ฆฝํ๋ณธ
- ๋ฐ์ดํฐ๋ถ์
- ๋น ๋ฐ์ดํฐ๋ถ์๊ธฐ์ฌ
- dataframe
- Lambda
- ์ฃผ์ฑ๋ถ๋ถ์
- ํ ์คํธ๋ถ์
- ๋ฐ์ดํฐ๋ถ์์ ๋ฌธ๊ฐ
- ๋์ํ๋ณธ
- ADP
- DBSCAN
- ์๋ํด๋ผ์ฐ๋
- opencv
- iloc
- Python
- numpy
- ๋น ๋ฐ์ดํฐ
- ์ค๋ฒ์ํ๋ง
Archives
Data Science LAB
[Python] matplotlib subplots ์ฌ์ฉ(์ฌ๋ฌ๊ฐ์ ๊ทธ๋ํ๋ฅผ ํ๋ฒ์) ๋ณธ๋ฌธ
๐ Python/์๊ฐํ
[Python] matplotlib subplots ์ฌ์ฉ(์ฌ๋ฌ๊ฐ์ ๊ทธ๋ํ๋ฅผ ํ๋ฒ์)
ใ ใ ใ ใ 2022. 8. 23. 16:52728x90
1. ๋ชจ๋ ๋ถ๋ฌ์ค๊ธฐ
import matplotlib.pyplot as plt
2. ๊ทธ๋ํ ๊ฐ์(ํ*์ด) ์ค์
plt.subplots(row, column, index)
fig,axs = plt.subplots(2,2)
# 2*2๊ฐ์ ๊ทธ๋ํ ์์ฑ
3. ๊ฐ ๊ทธ๋ํ๋ณ ์ํ๋ ๊ทธ๋ํ ์ค์
axs[0][0].bar(data['school'].value_counts().index, data['school'].value_counts().values)
axs[0][0].set_title('School')
axs[0][1].bar(data['sex'].value_counts().index, data['sex'].value_counts().values)
axs[0][1].set_title('Sex')
axs[1][0].bar(data['paid'].value_counts().index, data['paid'].value_counts().values)
axs[1][0].set_title('paid')
axs[1][1].bar(data['activities'].value_counts().index, data['activities'].value_counts().values)
axs[1][1].set_title('activities')
plt.show()
for ๋ฌธ์ ์ฌ์ฉํ๋ฉด ๋ ์งง์ ์ฝ๋๋ก๋ ์ฌ์ฉ ๊ฐ๋ฅํ๋ค.
728x90
'๐ Python > ์๊ฐํ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] Matplotlib ์๊ฐํ (0) | 2022.09.22 |
---|---|
[Python] Pandas๋ฅผ ์ด์ฉํ ์๊ฐํ (0) | 2022.09.21 |
[Python] Mac์์ Matplotlib ํ๊ธ ๊นจ์ง ํ์ ํด๊ฒฐ ๋ฐฉ๋ฒ (0) | 2022.09.20 |
[Python] matplotlib ํ๊ธ ๊นจ์ง ๋ฐฉ์ง, ํ๊ธ ์ถ๋ ฅ ๋ฐฉ๋ฒ (0) | 2022.08.26 |
Comments