import numpy as np
import matplotlib.pyplot as plt

from skimage.transform import hough_line

img = np.zeros((100, 150), dtype=bool)
img[30, :] = 1
img[:, 65] = 1
img[35:45, 35:50] = 1
for i in range(90):
    img[i, i] = 1
img += np.random.random(img.shape) > 0.95

out, angles, d = hough_line(img)

plt.subplot(1, 2, 1)

plt.imshow(img, cmap=plt.cm.gray)
plt.title('Input image')

plt.subplot(1, 2, 2)
plt.imshow(out, cmap=plt.cm.bone,
           extent=(np.rad2deg(angles[0]), np.rad2deg(angles[-1]),
                   d[0], d[-1]))
plt.title('Hough transform')
plt.xlabel('Angle (degree)')
plt.ylabel('Distance (pixel)')

plt.subplots_adjust(wspace=0.4)
plt.show()

@@ -85,16 +85,46 @@
 ugh_line
+%0Afrom skimage.draw import line
 %0A%0Aimg = 
@@ -212,40 +212,49 @@
 = 1%0A
-for i in range(90):%0A    img%5Bi, i
+rr, cc = line(60, 130, 80, 10)%0Aimg%5Brr, cc
 %5D = 
@@ -506,17 +506,18 @@
 (angles%5B
-0
+-1
 %5D), np.r
@@ -530,18 +530,17 @@
 (angles%5B
--1
+0
 %5D),%0A    
@@ -560,16 +560,16 @@
   d%5B
-0
+-1
 %5D, d%5B
--1
+0
 %5D))%0A

Fix and improve example