My problem
The shapefile xxx contain serval polygons, and I want to plot part of it.
So, I typed:
## reading the xxx.shp
map.readshapefile('xxx','xxx',zorder =1,)
patches=[]
## generating the indice which mean I want to plot these polygon.
indice = [int(i) for i in np.array([5,6,7,8,11,14,17])]
for info, shape in zip(map.xxx_info, map.xxx):
x,y=zip(*shape)
patches.append( Polygon(np.array(shape), True) )
ax.add_collection(PatchCollection(patches[indice], facecolor= \
'none',edgecolor='grey', linewidths=1.5, zorder=2,alpha = 0.8))
But the error like this:
TypeError: llist indices must be integers, not list.
I don't know how to fix it. Wish for yours' help!