2학년 2학기/데이터 사이언스 입문
[Visualization] Error Bar
kkkkk1023
2024. 11. 26. 22:21
In [1]:
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
Error Bar¶
- 평균과 표준편자를 표시하여 데이터의 전체적인 경향을 요약하여 표시할 때 사용한다.
- 즉, 많은 라벨의 데이터 들이 있을 때 라벨마다의 데이터 분포를 표시할 때 사용한다.
In [5]:
x = np.linspace(0, 10, 50)
dy = 0.8
y = np.sin(x) + dy * np.random.randn(50)
plt.errorbar(x, y, yerr=dy, fmt='.k')
plt.xlabel("Label")
plt.ylabel("Distribution of Label")
Out[5]:
Text(0, 0.5, 'Distribution of Label')
In [ ]: