Revision: 5795
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5795&view=rev
Author:   efiring
Date:     2008-07-20 07:14:46 +0000 (Sun, 20 Jul 2008)

Log Message:
-----------
In collections draw methods, use get_facecolor and get_edgecolor.
The logic for edgecolors='face' is moved into get_edgecolor so
that it will return the color(s) that will actually be used.
Using the getters means that a derived class can override
them to add more logic to the choice of colors.

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/collections.py

Modified: trunk/matplotlib/lib/matplotlib/collections.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/collections.py      2008-07-20 02:59:00 UTC 
(rev 5794)
+++ trunk/matplotlib/lib/matplotlib/collections.py      2008-07-20 07:14:46 UTC 
(rev 5795)
@@ -184,16 +184,12 @@
             offsets = transOffset.transform_non_affine(offsets)
             transOffset = transOffset.get_affine()
 
-        if self._edgecolors == 'face':
-            edgecolors = self._facecolors
-        else:
-            edgecolors = self._edgecolors
 
         renderer.draw_path_collection(
             transform.frozen(), self.clipbox, clippath, clippath_trans,
             paths, self.get_transforms(),
             offsets, transOffset,
-            self._facecolors, edgecolors, self._linewidths,
+            self.get_facecolor(), self.get_edgecolor(), self._linewidths,
             self._linestyles, self._antialiaseds)
         renderer.close_group(self.__class__.__name__)
 
@@ -315,7 +311,10 @@
     get_facecolors = get_facecolor
 
     def get_edgecolor(self):
-        return self._edgecolors
+        if self._edgecolors == 'face':
+            return self.get_facecolors()
+        else:
+            return self._edgecolors
     get_edgecolors = get_edgecolor
 
     def set_edgecolor(self, c):
@@ -534,7 +533,7 @@
         renderer.draw_quad_mesh(
             transform.frozen(), self.clipbox, clippath, clippath_trans,
             self._meshWidth, self._meshHeight, coordinates,
-            offsets, transOffset, self._facecolors, self._antialiased,
+            offsets, transOffset, self.get_facecolor(), self._antialiased,
             self._showedges)
         renderer.close_group(self.__class__.__name__)
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to