def histogram(data,binwidth, xmin,xmax): """generate bin-centered histogram of provided data return bins of given binwidth (and histogram) generated between [xmin,xmax]""" bins = arange(xmin,xmax, binwidth) binsc = bins + (0.5 * binwidth) try: #FIXME: use updated numpy.histogram histo = numpyhisto(data, bins, new=False)[0] except: histo = numpyhisto(data, bins)[0] return binsc[:len(histo)], histo
def histogram(data,binwidth,xmin,xmax): """ generate bin-centered histogram of provided data return bins of given binwidth (and histogram) generated between [xmin,xmax] """ edges = arange(xmin,xmax+binwidth*0.9999999, binwidth) centers = edges + (0.5 * binwidth) histo,_ = numpyhisto(data, bins=edges) #print data.size, sum(histo), edges[0], edges[-1], min(data),max(data) return centers, histo
def histogram(data, binwidth, xmin, xmax): """ generate bin-centered histogram of provided data return bins of given binwidth (and histogram) generated between [xmin,xmax] """ edges = arange(xmin, xmax + binwidth * 0.9999999, binwidth) centers = edges + (0.5 * binwidth) histo, _ = numpyhisto(data, bins=edges) #print data.size, sum(histo), edges[0], edges[-1], min(data),max(data) return centers, histo