+ if show_all:
+ import matplotlib.pyplot as pyplot
+ import Image
+
+ def plot_line_g((a, b, c), max_x):
+ find_y = lambda x: - (c + a * x) / b
+ pyplot.plot([0, max_x], [find_y(0), find_y(max_x)], color='b')
+
+ fig = pyplot.figure(figsize=(8, 6))
+ plot_line_g(diag1, size[0])
+ plot_line_g(diag2, size[0])
+ pyplot.scatter(*zip(*sum(points, [])))
+ pyplot.scatter([center[0]], [center[1]], color='r')
+ pyplot.xlim(0, size[0])
+ pyplot.ylim(0, size[1])
+ fig.canvas.draw()
+ size_f = fig.canvas.get_width_height()
+ buff = fig.canvas.tostring_rgb()
+ image_p = Image.fromstring('RGB', size_f, buff, 'raw')
+ do_something(image_p, "finding diagonal")
+
+