import numpy as np
import matplotlib.pyplot as plt

phi = (1 + 5**0.5)/2

def plotrect(lowerleft, upperright, color):
	x0, y0 = lowerleft
	x1, y1 = upperright
	plt.plot([x0, x1], [y0, y0], c=color)
	plt.plot([x0, x1], [y1, y1], c=color)
	plt.plot([x0, x0], [y0, y1], c=color)
	plt.plot([x1, x1], [y0, y1], c=color)

plt.gca().set_aspect("equal")   

plotrect((0, 0), (phi, 1), "black")
plotrect((0, 0), (1, 1), "blue")
plotrect((1, 2-phi), (phi, 1), "green")
plotrect((2*phi - 2,0), (phi, 2-phi), "orange")
plotrect((1,0), (2*phi-2,2*phi-3), "red")
plt.plot([0, phi], [1, 0], "--", color="gray")
plt.plot([1, phi], [0, 1], "--", color="gray")
plt.show()
#plt.savefig("golden_rect5.png")