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

def plot(shape_records,facecolor='w',edgecolor='k',linewidths=.5, ax=None,xlims=None,ylims=None):
    """
    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
    """
    #Axes handle
    if ax is None:
        fig     = pb.figure()
        ax      = fig.add_subplot(111)

    #Iterate over shape_records
    for srec in shape_records:
        points = np.vstack(srec.shape.points)
        sparts = srec.shape.parts
        par = list(sparts) + [points.shape[0]]

        polygs = []
        for pj in range(len(sparts)):
            polygs.append(Polygon(points[par[pj]:par[pj+1]]))
        ax.add_collection(PatchCollection(polygs,facecolor=facecolor,edgecolor=edgecolor, linewidths=linewidths))

    #Plot limits
    _box = np.vstack([srec.shape.bbox for srec in shape_records])
    minx,miny = np.min(_box[:,:2],0)
    maxx,maxy = np.max(_box[:,2:],0)

    if xlims is not None:
        minx,maxx = xlims
    if ylims is not None:
        miny,maxy = ylims
    ax.set_xlim(minx,maxx)
    ax.set_ylim(miny,maxy)