Logo Search packages:      
Sourcecode: matplotlib version File versions  Download package

def matplotlib::collections::PatchCollection::get_transformed_patches (   self  )  [inherited]

get a sequence of the polygons in the collection in display (transformed) space

The ith element in the returned sequence is a list of x,y
vertices defining the ith polygon

Definition at line 167 of file collections.py.

00167                                      :
        """
        get a sequence of the polygons in the collection in display (transformed) space

        The ith element in the returned sequence is a list of x,y
        vertices defining the ith polygon
        """

        verts = self._verts
        offsets = self._offsets
        usingOffsets = offsets is not None
        transform = self.get_transform()
        transOffset = self.get_transoffset()
        Noffsets = 0
        Nverts = len(verts)
        if usingOffsets:
            Noffsets = len(offsets)

        N = max(Noffsets, Nverts)

        data = []
        #print 'verts N=%d, Nverts=%d'%(N, Nverts), verts
        #print 'offsets; Noffsets=%d'%Noffsets
        for i in xrange(N):
            #print 'i%%Nverts=%d'%(i%Nverts)
            polyverts = verts[i % Nverts]
            if npy.any(npy.isnan(polyverts)):
                continue
            #print 'thisvert', i, polyverts
            tverts = transform.seq_xy_tups(polyverts)
            if usingOffsets:
                #print 'using offsets'
                xo,yo = transOffset.xy_tup(offsets[i % Noffsets])
                tverts = [(x+xo,y+yo) for x,y in tverts]

            data.append(tverts)
        return data

    def get_transoffset(self):


Generated by  Doxygen 1.6.0   Back to index