y = [0, 0, 0, 0, 1, 1, 2]
z = ['b', 'g', 'r', 'c', 'm', 'y', 'k']
dx = [x[1] - x[0]] * len(x)
fig = plt.figure()
ax = fig.add_subplot(111, aspect='equal')
ax.axis([min(x) - 1.0, max(x) + 1.0, min(y) - 1.0, max(y) + 1.0])
for x, y, c, h in zip(x, y, z, dx):
    ax.add_artist(Rectangle(xy=(x - h / 2.0, y - h / 2.0), color=c, width=h,
        height=h))
fig.savefig('test.png')
Choosing marker size in Matplotlib