From: Alexander Crosby <AC<rosby@as...>  20120619 16:06:13

The code below is a stripped down version of the way i am implementing a clip operation, but it is slow and memory inefficient. Is there a way to do this without looping or just faster, perhaps with a PolygonCollection? I have code that finds the perimeter path of a triangulation like this, but it turns out that my topology is not well formed enough for it to work. Is there a hidden matplotlib method to combine or dissolve Polygons/Patches? Thanks, Alex  import matplotlib.tri as Tri import matplotlib.patches as patches tri = Tri.Triangulation(lonn,latn,triangles=nv) for triangle in tri.triangles: p = patches.Polygon( numpy.vstack( (lonn[triangle].T,latn[triangle].T,) ).T ) m.imshow(zi, norm=CNorm, cmap=colormap, clip_path=p) 