■ plot 함수를 사용해 1차 방정식을 그리는 방법을 보여준다.
▶ 예제 코드 (PY)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import matplotlib.pyplot as pp import numpy as np xNDArray = np.arange(0, 10, 0.01) yNDArray = 3 * xNDArray + 5 yNoiseNDArray = yNDArray + np.random.randn(len(yNDArray)) pp.figure(figsize = (12, 8)) pp.plot(xNDArray, yNoiseNDArray, label = "noise", color = "y") pp.plot(xNDArray, yNDArray, ls = "dashed", lw = 3, color = "b", label = "original") pp.show(); |