diff --git a/skimage/draw/draw.py b/skimage/draw/draw.py index f262b1c2..72093d7b 100644 --- a/skimage/draw/draw.py +++ b/skimage/draw/draw.py @@ -28,7 +28,6 @@ def ellipse(cy, cx, yradius, xradius, shape=None): May be used to directly index into an array, e.g. ``img[rr, cc] = 1``. - Examples -------- >>> from skimage.draw import ellipse @@ -89,6 +88,25 @@ def circle(cy, cx, radius, shape=None): Notes ----- This function is a wrapper for skimage.draw.ellipse() + + Examples + -------- + >>> from skimage.draw import circle + >>> img = np.zeros((10, 10), dtype=np.uint8) + >>> rr, cc = circle(4, 4, 5) + >>> img[rr, cc] = 1 + >>> img + array([[0, 0, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 1, 1, 1, 1, 1, 1, 1, 0, 0], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], + [1, 1, 1, 1, 1, 1, 1, 1, 1, 0], + [0, 1, 1, 1, 1, 1, 1, 1, 0, 0], + [0, 0, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], dtype=uint8) + """ return ellipse(cy, cx, radius, radius, shape)