# 주피터 노트북에서 그래프 출력 가능하게 선언하는 명령어
%matplotlib inline
import matplotlib.pyplot as plt
막대 그래프 출력하기
y = df['Births']
x = df['Names']
plt.bar(x, y) # 막대 그래프 개체 생성
plt.xlabel('Names') # x축 제목
plt.ylabel('Births') # y축 제목
plt.title('Bar plto') # 그래프 제목
plt.show() # 그래프 출력
산점도 그래프 출력하기
# 랜덤 추출 시드 고정
np.random.seed(19981105)
# 산점도 데이터 생성
x = np.arange(0.0, 100.0, 5.0)
y = (x * 1.5) + np.random.rand(20) * 50
# 산점도 데이터 출력
plt.scatter(x, y, c = 'b', alpha = 0.5, label = 'scatter point')
plt.xlabel('X')
plt.ylabel('Y')
plt.legend(loc = 'upper left')
plt.title('Scatter plot')
plt.show()