๋ชฉ์ฐจ
์ ๊ธฐ
๊ทธ๋ฆฌ๋๋? 2์ฐจ์ ์์ญ์ ๋ํ (x,y)์ ์ขํ๊ฐ ์.
metplotlib ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ค.
๋ณ์๊ฐ 2๊ฐ์ธ 2์ฐจ์ ํจ์์ ๊ทธ๋ํ๋ฅผ ๊ทธ๋ฆฌ๊ฑฐ๋ ํ๋ฅผ ๊ทธ๋ฆฌ๊ณ ์ ํ๋ ๊ฒฝ์ฐ metplotlib ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฌ์ฉํ๋ค.
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(3)
y = np.arange(5)
X, Y = np.meshgrid(x, y)
print(X)
print(Y)
plt.title('Grid Points')
plt.scatter(X, Y, linewidths=1) # ์ฐ์ ๋
plt.show()
[์ฝ๋ ์คํ ๊ฒฐ๊ณผ]
๋ญ๊ฐ๊ฐ ํ์ ๋๋ค..ใ
[[0 1 2]
[0 1 2]
[0 1 2]
[0 1 2]
[0 1 2]]
[[0 0 0]
[1 1 1]
[2 2 2]
[3 3 3]
[4 4 4]]
728x90