Thursday, 15 July 2010

python - how to scale the histogram plot via matplotlib -



python - how to scale the histogram plot via matplotlib -

you can see there histogram below. made pl.hist(data1,bins=20,color='green',histtype="step",cumulative=-1) how scale histogram? example, allow height of histogram 1 3rd of now.

besides, way remove vertical line @ left?

the matplotlib hist making calls other functions. easier utilize these straight allowing inspect info , modify directly:

# generate info data = np.random.normal(size=1000) # generate histogram info straight hist, bin_edges = np.histogram(data, bins=10) # reversed cumulative sum hist_neg_cumulative = [np.sum(hist[i:]) in range(len(hist))] # cin centres rather edges bin_centers = (bin_edges[:-1] + bin_edges[1:]) / 2. # plot plt.step(bin_centers, hist_neg_cumulative) plt.show()

the hist_neg_cumulative array of info beingness plotted. can rescale wish before passing plotting function. doesn't plot vertical line.

python matplotlib histogram

No comments:

Post a Comment