익숙해질때까지~
import numpy as np
import matplotlib.pyplot as plt
#간단한 그래프 그리기
x = np.arange(0,6,0.1)
y = np.sin(x)
plt.plot(x,y)
plt.show()
x = np.arange(0,10,0.1)
y = np.sin(x)
plt.plot(x,y)
plt.show()
#pyplot
x = np.arange(0,6,0.1)
y1 = np.sin(x)
y2 = np.cos(x)
plt.plot(x,y1,label='sin')
plt.plot(x,y2,linestyle="--",label = "cos") #점선
plt.xlabel("x")
plt.ylabel("y")
plt.title("sin & cos")
plt.legend() #왼쪽 밑의 설명 표시
plt.show()
'Data Science > 파이썬 기본문법' 카테고리의 다른 글
[파이썬] random 모듈 randint, randn, rand (0) | 2020.04.30 |
---|---|
[파이썬] gzip , rb, savez (0) | 2020.04.29 |
[파이썬] NUMPY 기본 문법 복습 (0) | 2020.04.22 |
모든 순열 구하는 방법(재귀함수를 활용) (1) | 2020.04.06 |
[파이썬]DFS BFS 연습할 기본 코드 (1) | 2020.03.29 |
댓글