Calculates bin width and number of bins for histogram using Freedman-Diaconis rule, if rule fails, defaults to square-root method
Parameters: | data : array_like
verbose : boolean (optional)
|
---|---|
Returns: | out : tuple
|
See also
Examples
>>> import numpy, spacepy
>>> import matplotlib.pyplot as plt
>>> numpy.random.seed(8675301)
>>> data = numpy.random.randn(1000)
>>> binw, nbins = spacepy.toolbox.binHisto(data)
>>> print(nbins)
19.0
>>> p = plt.hist(data, bins=nbins, histtype='step', normed=True)