2014-06-23 2 views

답변

5

하기 matplotlib hist 실제로 단지 다른 함수를 호출하고 있습니다.

# Generate some data 
data = np.random.normal(size=1000) 

# Generate the histogram data directly 
hist, bin_edges = np.histogram(data, bins=10) 

# Get the reversed cumulative sum 
hist_neg_cumulative = [np.sum(hist[i:]) for i in range(len(hist))] 

# Get the cin centres rather than the edges 
bin_centers = (bin_edges[:-1] + bin_edges[1:])/2. 

# Plot 
plt.step(bin_centers, hist_neg_cumulative) 

plt.show() 

hist_neg_cumulative가 플롯되는 데이터의 배열입니다 : 당신이 데이터를 검사 할 수 있도록 이것들을 직접 사용하고 직접 수정하는 것이 종종 더 쉽다. 따라서 플로팅 함수에 전달하기 전에 원하는대로 다시 스케일을 조정할 수 있습니다. 또한 수직선을 플롯하지 않습니다.

관련 문제