From 1108727ed86454894523081fa6c39400d5b3127b Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Wed, 12 Sep 2012 21:38:00 -0400 Subject: [PATCH 1/2] DOC: Replace doctest with literal code block --- skimage/transform/finite_radon_transform.py | 12 ++++++------ skimage/transform/hough_transform.py | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/skimage/transform/finite_radon_transform.py b/skimage/transform/finite_radon_transform.py index fa84c5e3..f2d4705d 100644 --- a/skimage/transform/finite_radon_transform.py +++ b/skimage/transform/finite_radon_transform.py @@ -46,13 +46,13 @@ def frt2(a): >>> f = frt2(img) - Plot the results: + Plot the results:: - >>> import matplotlib.pyplot as plt - >>> plt.imshow(f, interpolation='nearest', cmap=plt.cm.gray) - >>> plt.xlabel('Angle') - >>> plt.ylabel('Translation') - >>> # plt.show() + import matplotlib.pyplot as plt + plt.imshow(f, interpolation='nearest', cmap=plt.cm.gray) + plt.xlabel('Angle') + plt.ylabel('Translation') + plt.show() References ---------- diff --git a/skimage/transform/hough_transform.py b/skimage/transform/hough_transform.py index 0e1fb9bf..563f9d1b 100644 --- a/skimage/transform/hough_transform.py +++ b/skimage/transform/hough_transform.py @@ -131,13 +131,13 @@ def hough(img, theta=None): >>> out, angles, d = hough(img) - Plot the results: + Plot the results:: - >>> import matplotlib.pyplot as plt - >>> plt.imshow(out, cmap=plt.cm.bone) - >>> plt.xlabel('Angle (degree)') - >>> plt.ylabel('Distance %d (pixel)' % d[0]) - >>> # plt.show() + import matplotlib.pyplot as plt + plt.imshow(out, cmap=plt.cm.bone) + plt.xlabel('Angle (degree)') + plt.ylabel('Distance %d (pixel)' % d[0]) + plt.show() .. plot:: hough_tf.py From b433e8ecef09c2d5501f946af974aea2e290bc97 Mon Sep 17 00:00:00 2001 From: Tony S Yu Date: Thu, 13 Sep 2012 09:28:12 -0400 Subject: [PATCH 2/2] DOC: Remove plots from docstring examples Plotting isn't really necessary in a docstring example. Both of these functions already have gallery examples. --- skimage/transform/finite_radon_transform.py | 8 -------- skimage/transform/hough_transform.py | 8 -------- 2 files changed, 16 deletions(-) diff --git a/skimage/transform/finite_radon_transform.py b/skimage/transform/finite_radon_transform.py index f2d4705d..c107546f 100644 --- a/skimage/transform/finite_radon_transform.py +++ b/skimage/transform/finite_radon_transform.py @@ -46,14 +46,6 @@ def frt2(a): >>> f = frt2(img) - Plot the results:: - - import matplotlib.pyplot as plt - plt.imshow(f, interpolation='nearest', cmap=plt.cm.gray) - plt.xlabel('Angle') - plt.ylabel('Translation') - plt.show() - References ---------- .. [FRT] A. Kingston and I. Svalbe, "Projective transforms on periodic diff --git a/skimage/transform/hough_transform.py b/skimage/transform/hough_transform.py index 563f9d1b..4e3acd6e 100644 --- a/skimage/transform/hough_transform.py +++ b/skimage/transform/hough_transform.py @@ -131,14 +131,6 @@ def hough(img, theta=None): >>> out, angles, d = hough(img) - Plot the results:: - - import matplotlib.pyplot as plt - plt.imshow(out, cmap=plt.cm.bone) - plt.xlabel('Angle (degree)') - plt.ylabel('Distance %d (pixel)' % d[0]) - plt.show() - .. plot:: hough_tf.py """