Add example to circle drawing function

This commit is contained in:
Johannes Schönberger
2013-05-27 21:19:25 +02:00
parent bc3a804093
commit f31193c099
+19 -1
View File
@@ -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)