def plot(shape_records,facecolor='<STR_LIT:w>',edgecolor='<STR_LIT:k>',linewidths=<NUM_LIT>, ax=None,xlims=None,ylims=None):
<EOL>if ax is None:<EOL><INDENT>fig     = pb.figure()<EOL>ax      = fig.add_subplot(<NUM_LIT>)<EOL><DEDENT>for srec in shape_records:<EOL><INDENT>points = np.vstack(srec.shape.points)<EOL>sparts = srec.shape.parts<EOL>par = list(sparts) + [points.shape[<NUM_LIT:0>]]<EOL>polygs = []<EOL>for pj in range(len(sparts)):<EOL><INDENT>polygs.append(Polygon(points[par[pj]:par[pj+<NUM_LIT:1>]]))<EOL><DEDENT>ax.add_collection(PatchCollection(polygs,facecolor=facecolor,edgecolor=edgecolor, linewidths=linewidths))<EOL><DEDENT>_box = np.vstack([srec.shape.bbox for srec in shape_records])<EOL>minx,miny = np.min(_box[:,:<NUM_LIT:2>],<NUM_LIT:0>)<EOL>maxx,maxy = np.max(_box[:,<NUM_LIT:2>:],<NUM_LIT:0>)<EOL>if xlims is not None:<EOL><INDENT>minx,maxx = xlims<EOL><DEDENT>if ylims is not None:<EOL><INDENT>miny,maxy = ylims<EOL><DEDENT>ax.set_xlim(minx,maxx)<EOL>ax.set_ylim(miny,maxy)<EOL>
Plot the geometry of a shapefile

:param shape_records: geometry and attributes list
:type shape_records: ShapeRecord object (output of a shapeRecords() method)
:param facecolor: color to be used to fill in polygons
:param edgecolor: color to be used for lines
:param ax: axes to plot on.
:type ax: axes handle