lib/matplotlib/backend_bases.py
def _iter_collection(self, gc, path_ids, offsets, offsetTrans, facecolors,
                         edgecolors, linewidths, linestyles, antialiaseds,
                         urls):
        """
        This is a helper method (along with
        :meth:`_iter_collection_raw_paths`) to make it easier to write
        a space-efficent :meth:`draw_path_collection` implementation in a
        backend.

        This method yields all of the path, offset and graphics
        context combinations to draw the path collection.  The caller
        should already have looped over the results of
        :meth:`_iter_collection_raw_paths` to draw this collection.

        The arguments should be the same as that passed into
        :meth:`draw_path_collection`, with the exception of
        *path_ids*, which is a list of arbitrary objects that the
        backend will use to reference one of the paths created in the
        :meth:`_iter_collection_raw_paths` stage.

        Each yielded result is of the form::

           xo, yo, path_id, gc, rgbFace

        where *xo*, *yo* is an offset; *path_id* is one of the elements of
        *path_ids*; *gc* is a graphics context and *rgbFace* is a color to
        use for filling the path.
        """
        Npaths      = len(path_ids)
        Noffsets    = len(offsets)
        N           = max(Npaths, Noffsets)
        Nfacecolors = len(facecolors)
        Nedgecolors = len(edgecolors)
        Nlinewidths = len(linewidths)
        Nlinestyles = len(linestyles)
        Naa         = len(antialiaseds)
        Nurls       = len(urls)

        if (Nfacecolors == 0 and Nedgecolors == 0) or Npaths == 0:
            return
        if Noffsets:
            toffsets = offsetTrans.transform(offsets)

        gc0 = self.new_gc()
        gc0.copy_properties(gc)

        if Nfacecolors == 0:
            rgbFace = None

        if Nedgecolors == 0:
            gc0.set_linewidth(0.0)

        xo, yo = 0, 0
        for i in xrange(N):
            path_id = path_ids[i % Npaths]
            if Noffsets:
                xo, yo = toffsets[i % Noffsets]
            if Nfacecolors:
                rgbFace = facecolors[i % Nfacecolors]
            if Nedgecolors:
                gc0.set_foreground(edgecolors[i % Nedgecolors])
                if Nlinewidths:
                    gc0.set_linewidth(linewidths[i % Nlinewidths])
                if Nlinestyles:
                    gc0.set_dashes(*linestyles[i % Nlinestyles])
            if rgbFace is not None and len(rgbFace)==4:
                gc0.set_alpha(rgbFace[-1])
                rgbFace = rgbFace[:3]
            gc0.set_antialiased(antialiaseds[i % Naa])
            if Nurls:
                gc0.set_url(urls[i % Nurls])

            yield xo, yo, path_id, gc0, rgbFace
        gc0.restore()

        This is a helper method (along with
        :meth:`_iter_collection_raw_paths`) to make it easier to write
        a space-efficent :meth:`draw_path_collection` implementation in a
        backend.

        This method yields all of the path, offset and graphics
        context combinations to draw the path collection.  The caller
        should already have looped over the results of
        :meth:`_iter_collection_raw_paths` to draw this collection.

        The arguments should be the same as that passed into
        :meth:`draw_path_collection`, with the exception of
        *path_ids*, which is a list of arbitrary objects that the
        backend will use to reference one of the paths created in the
        :meth:`_iter_collection_raw_paths` stage.

        Each yielded result is of the form::

           xo, yo, path_id, gc, rgbFace

        where *xo*, *yo* is an offset; *path_id* is one of the elements of
        *path_ids*; *gc* is a graphics context and *rgbFace* is a color to
        use for filling the path.
        
This is a helper method (along with
This is a helper method ( along with
def _iter_collection(self, gc, path_ids, offsets, offsetTrans, facecolors,
                         edgecolors, linewidths, linestyles, antialiaseds,
                         urls):
        Npaths      = len(path_ids)
        Noffsets    = len(offsets)
        N           = max(Npaths, Noffsets)
        Nfacecolors = len(facecolors)
        Nedgecolors = len(edgecolors)
        Nlinewidths = len(linewidths)
        Nlinestyles = len(linestyles)
        Naa         = len(antialiaseds)
        Nurls       = len(urls)
        if (Nfacecolors == 0 and Nedgecolors == 0) or Npaths == 0:
            return
        if Noffsets:
            toffsets = offsetTrans.transform(offsets)
        gc0 = self.new_gc()
        gc0.copy_properties(gc)
        if Nfacecolors == 0:
            rgbFace = None
        if Nedgecolors == 0:
            gc0.set_linewidth(0.0)
        xo, yo = 0, 0
        for i in xrange(N):
            path_id = path_ids[i % Npaths]
            if Noffsets:
                xo, yo = toffsets[i % Noffsets]
            if Nfacecolors:
                rgbFace = facecolors[i % Nfacecolors]
            if Nedgecolors:
                gc0.set_foreground(edgecolors[i % Nedgecolors])
                if Nlinewidths:
                    gc0.set_linewidth(linewidths[i % Nlinewidths])
                if Nlinestyles:
                    gc0.set_dashes(*linestyles[i % Nlinestyles])
            if rgbFace is not None and len(rgbFace)==4:
                gc0.set_alpha(rgbFace[-1])
                rgbFace = rgbFace[:3]
            gc0.set_antialiased(antialiaseds[i % Naa])
            if Nurls:
                gc0.set_url(urls[i % Nurls])
            yield xo, yo, path_id, gc0, rgbFace
        gc0.restore()
def _iter_collection ( self , gc , path_ids , offsets , offsetTrans , facecolors , edgecolors , linewidths , linestyles , antialiaseds , urls ) : Npaths = len ( path_ids ) Noffsets = len ( offsets ) N = max ( Npaths , Noffsets ) Nfacecolors = len ( facecolors ) Nedgecolors = len ( edgecolors ) Nlinewidths = len ( linewidths ) Nlinestyles = len ( linestyles ) Naa = len ( antialiaseds ) Nurls = len ( urls ) if ( Nfacecolors == 0 and Nedgecolors == 0 ) or Npaths == 0 : return if Noffsets : toffsets = offsetTrans . transform ( offsets ) gc0 = self . new_gc ( ) gc0 . copy_properties ( gc ) if Nfacecolors == 0 : rgbFace = None if Nedgecolors == 0 : gc0 . set_linewidth ( 0.0 ) xo , yo = 0 , 0 for i in xrange ( N ) : path_id = path_ids [ i % Npaths ] if Noffsets : xo , yo = toffsets [ i % Noffsets ] if Nfacecolors : rgbFace = facecolors [ i % Nfacecolors ] if Nedgecolors : gc0 . set_foreground ( edgecolors [ i % Nedgecolors ] ) if Nlinewidths : gc0 . set_linewidth ( linewidths [ i % Nlinewidths ] ) if Nlinestyles : gc0 . set_dashes ( * linestyles [ i % Nlinestyles ] ) if rgbFace is not None and len ( rgbFace ) == 4 : gc0 . set_alpha ( rgbFace [ - 1 ] ) rgbFace = rgbFace [ : 3 ] gc0 . set_antialiased ( antialiaseds [ i % Naa ] ) if Nurls : gc0 . set_url ( urls [ i % Nurls ] ) yield xo , yo , path_id , gc0 , rgbFace gc0 . restore ( )
This is a helper method (along with
This is a helper method ( along with
"""
        This is a helper method (along with
        :meth:`_iter_collection_raw_paths`) to make it easier to write
        a space-efficent :meth:`draw_path_collection` implementation in a
        backend.

        This method yields all of the path, offset and graphics
        context combinations to draw the path collection.  The caller
        should already have looped over the results of
        :meth:`_iter_collection_raw_paths` to draw this collection.

        The arguments should be the same as that passed into
        :meth:`draw_path_collection`, with the exception of
        *path_ids*, which is a list of arbitrary objects that the
        backend will use to reference one of the paths created in the
        :meth:`_iter_collection_raw_paths` stage.

        Each yielded result is of the form::

           xo, yo, path_id, gc, rgbFace

        where *xo*, *yo* is an offset; *path_id* is one of the elements of
        *path_ids*; *gc* is a graphics context and *rgbFace* is a color to
        use for filling the path.
        """
self
gc
path_ids
offsets
offsetTrans
facecolors
edgecolors
linewidths
linestyles
antialiaseds
urls
meth
`_iter_collection_raw_paths`) to make it easier to write
a space-efficent :meth:`draw_path_collection` implementation in a
backend.

This method yields all of the path, offset and graphics
context combinations to draw the path collection.  The caller
should already have looped over the results of
` _iter_collection_raw_paths ` ) to make it easier to write a space - efficent : meth : ` draw_path_collection ` implementation in a backend . This method yields all of the path offset and graphics context combinations to draw the path collection . The caller should already have looped over the results of
meth
`_iter_collection_raw_paths` to draw this collection.
The arguments should be the same as that passed into
` _iter_collection_raw_paths ` to draw this collection . The arguments should be the same as that passed into
meth
`draw_path_collection`, with the exception of
path_ids*, which is a list of arbitrary objects that the
backend will use to reference one of the paths created in the
` draw_path_collection ` with the exception of path_ids * which is a list of arbitrary objects that the backend will use to reference one of the paths created in the
meth
`_iter_collection_raw_paths` stage.
Each yielded result is of the form:.

xo, yo, path_id, gc, rgbFace


` _iter_collection_raw_paths ` stage . Each yielded result is of the form : . xo yo path_id gc rgbFace