matplotlib
matplotlib
: ๋ฐ์ดํฐ๋ฅผ ์ฐจํธ(chart)๋ ํ๋กฏ(plot)์ผ๋ก ์๊ฐํ(visulaization)ํ๋ ํจํค์ง ๋ฐ์ดํฐ ๋ถ์์์ Matplotlib์ ๋ฐ์ดํฐ ๋ถ์ ์ด์ ์ ๋ฐ์ดํฐ ์ดํด๋ฅผ ์ํ ์๊ฐํ๋, ๋ฐ์ดํฐ ๋ถ์ ํ์ ๊ฒฐ๊ณผ๋ฅผ ์๊ฐํํ๊ธฐ ์ํด์ ์ฌ์ฉ
pip install matplotlib๋จ์ํ ๊ทธ๋ํ ๊ทธ๋ฆฌ๊ธฐ
: ๊ทธ๋ํ๋ฅผ ๊ทธ๋ฆฌ๊ธฐ ์ํด์๋ matplotlib์ pyplot
import numpy as np
import matplotlib.pyplot as plt
# ๋ฐ์ดํฐ ์ค๋น
x = np.arange(0, 6, 0.1) # 0์์ 6๊น์ง 0.1 ๊ฐ๊ฒฉ์ผ๋ก ์์ฑ
y = np.sin(x)
# ๊ทธ๋ํ
plt.plot(x, y)
plt.show()
pyplot์ด ๊ธฐ๋ฅ
: ์ ๋ชฉ๊ณผ ๊ฐ ์ถ์ ์ด๋ฆ(๋ ์ด๋ธ) ํ์ ๋ฑ์ ์ฌ์ฉํ ์ ์๋ค

์ด๋ฏธ์ง ํ์ํ๊ธฐ
: pyplot์๋ ์ด๋ฏธ์ง๋ฅผ ํ์ํด์ฃผ๋ ๋ฉ์๋์ธ imshow()๋ ์๋ค. ์ด๋ฏธ์ง๋ฅผ ์ฝ์ด ๋ค์ผ ๋๋ matplotlib.image๋ชจ๋์ imread()๋ฉ์๋๋ฅผ ์ด์ฉ
Last updated
Was this helpful?