Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

iterating plots

I want to plot several polygon whose coordonates are in a list. I know that we can add plot or use =+. But I wonder if there is a mechanism as sum() which can be iterated.

iterating plots

I want to plot several polygon whose coordonates are in a list. I know that we can add plot or use =+. But I wonder if there is a mechanism as sum() which can be iterated.iterated. For instance, this gives an error

l=list([1, 2, 3, 5])
ll=list([10, 20, 30, 40])
sum(plot(polygon([(l[j],0),(l[j],ll[j]),(l[j+1],ll[j]),(l[j+1],0)]) for j in range(len(l)-1)))