I have a list of points that
import matplotlib.pyplot as plt
polygons = [[(5.0, 0.05), (10.0, 0.05), (10.0, -0.05), (5.0, -0.05)],
[(0.0, 0.05), (5.0, 0.05), (5.0, -0.05), (0.0, -0.05)]]
coord = []
for item in polygons:
coord.extend(item)
coord.append(coord[0]) #repeat the first point to create a 'closed loop'
xs, ys = zip(*coord) #create lists of x and y values
plt.figure()
plt.fill(xs,ys,'k')
plt.ylim(-1, 1)
plt.xlim(0, 10)
plt.show()
And get the following picture:
which is wrong the plot should look like this, two rectangles next to each other:

How can I loop through the list in a correct way and assign the values to corresponding x and y to plot the correct image?
