Fixes to make doctests pass.

This commit is contained in:
Tony S Yu
2013-04-25 23:13:41 -05:00
parent 5123692f45
commit f2ace75369
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -36,11 +36,11 @@ def histogram(image, nbins=256):
Examples
--------
>>> camera = skimage.data.camera()
>>> hi = exposure.histogram(camera)
>>> # Plot histogram
>>> from skimage import data
>>> hist = histogram(data.camera())
>>> import matplotlib.pyplot as plt
>>> plt.plot(hi[1], hi[0])
>>> plt.plot(hist[1], hist[0]) # doctest: +ELLIPSIS
[...]
"""
# For integer types, histogramming with bincount is more efficient.
+1 -1
View File
@@ -46,7 +46,7 @@ def median_filter(image, radius=2, mask=None, percent=50):
--------
>>> a = np.ones((5, 5))
>>> a[2, 2] = 10 # introduce outlier
>>> b = filter.median_filter(a)
>>> b = median_filter(a)
>>> b[2, 2] # the median filter is good at removing outliers
1.0
'''
+1 -1
View File
@@ -103,7 +103,7 @@ def find_contours(array, level,
array([[ 1., 0., 0.],
[ 0., 0., 0.],
[ 0., 0., 0.]])
>>> measure.find_contours(a, 0.5)
>>> find_contours(a, 0.5)
[array([[ 0. , 0.5],
[ 0.5, 0. ]])]
"""