numpy - Python histogram with points and error bars -
i want plot histogram points , error bars. not want bar or step histograms. possible? google has not helped me, hope can. should not normalized. thanks!
assuming you're using numpy , matplotlib, can bin edges , counts using np.histogram()
, use pp.errorbar()
plot them:
import numpy np matplotlib import pyplot pp x = np.random.randn(10000) counts,bin_edges = np.histogram(x,20) bin_centres = (bin_edges[:-1] + bin_edges[1:])/2. err = np.random.rand(bin_centres.size)*100 pp.errorbar(bin_centres, counts, yerr=err, fmt='o') pp.show()
i'm not sure mean 'normalized', easy to, example, divide counts total number of values histogram sums 1.
the bigger question me errorbars mean in context of histogram, you're dealing absolute counts each bin.
Comments
Post a Comment