1. Matplotlib, Seaborn
- Matplotlib
- python 프로그래밍 언어 및 수학적 확장 NumPy 라이브러리를 활용한 라이브러리
- 데이터 시각화와 2D 그래프 플롯에 사용된다.
- Seaborn
- matplotlib 기반의 파이썬 데이터 시각화 라이브러리.
2. Matplotlib

2-1. Matplotlib 기본 사용
import numpy as np
import matplotlib.pyplot as plt
plt.show()
plt.plot([x 값], [y값])
plt.plot([],[], data = data_dict)
plt.xlabel("x축",loc="위치")
plt.legend(loc='위치')
plt.xlim(범위 지정)
plt.fill_between(x[1:3],y[1:3])
plt.xscale('log')
plt.grid(True,axis='x')
plt.title("타이틀이름")
fig=plt.figure()
fig.subplot(2,2,1)
plt.subplot(2,2,2)
2-2. bar graph(막대 그래프)
- 범주가 있는 데이터 값을 막대로 표현하는 그래프
ax = plt.bar(x,y)
plt.bar_label(ax, labels =[f'{x:,.0f}' for x in ax.datavalues] , label_type)
plt.barh(x,y)
subject = ['English', 'Math', 'Korean', 'Science', 'Computer']
points = [40, 90, 50, 60, 100]
plt.barh(subject,points)
2-3. line graph(선 그래프)
plt.plot(x,y)
2-4. Scatter (산점도)
plt.scatter(x,y)
plt.scatter(x,y, s = area , c = color)
plt(x,y,alpha = 0.5,cmap = 'spectral')
2-5. histogram
plt.hist(value1 , value2)
plt.hist(value, bins = 2)
2-6. Pie chart
plt.plot(value,labels = , autopct = '어느자리 숫자 까지 표시')
2-7. heatmap
- 다양한 값을 갖는 숫자 데이터를 열분포 형태와 같이 색상을 이용해 시각화한 것
plt.matshow(df)
plt.colorbar()
plt.pcolor(df)
plt.colorbar()
plt.clim(-3,0,3.0)