diff --git a/skimage/exposure/exposure.py b/skimage/exposure/exposure.py index c7f1e712..10d2427d 100644 --- a/skimage/exposure/exposure.py +++ b/skimage/exposure/exposure.py @@ -14,6 +14,7 @@ __all__ = ['histogram', 'cumulative_distribution', 'equalize', def histogram(image, nbins=256): """Return histogram of image. + Unlike `numpy.histogram`, this function returns the centers of bins and does not rebin integer arrays. For integer arrays, each integer value has its own bin, which improves speed and intensity-resolution. @@ -32,6 +33,14 @@ def histogram(image, nbins=256): The values of the histogram. bin_centers : array The values at the center of the bins. + + Examples + -------- + >>> camera = skimage.data.camera() + >>> hi = exposure.histogram(camera) + >>> # Plot histogram + >>> import matplotlib.pyplot as plt + >>> plt.plot(hi[1], hi[0]) """ # For integer types, histogramming with bincount is more efficient.