I want to plot rectangles in different subplots (find the code below), but it doesn't work. With arrays of numbers the code works (and I get the three subplots), however, with Rectangles is different, and I get two empty subplots and one with the rectangle. Any ideas about what's wrong? Thanks!
n = 3
fig = plt.figure()
for i in xrange(n):
ax = fig.add_subplot(n, 1, i+1)
ax.add_patch(matplotlib.patches.Rectangle((i,0), 100, 100, color="green"))
plt.show()
