import matplotlib.pyplot as pt from math import sqrt
a = 0 b = 1 m1 = a + (1-(sqrt(5)-1)/2) * (b-a) m2 = a + (sqrt(5)-1)/2 * (b-a)
pt.xlim([a-0.5, b+0.5]) pt.grid() pt.plot([a,b], [0,0], "ob") pt.plot([m1, m2], [0,0], "or")
[<matplotlib.lines.Line2D at 0x7fa0717e64e0>]