Revision: 8022
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8022&view=rev
Author:   leejjoon
Date:     2009-12-11 16:57:46 +0000 (Fri, 11 Dec 2009)

Log Message:
-----------
Axes.draw rearranged to support rasterization

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

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2009-12-11 00:59:34 UTC (rev 
8021)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2009-12-11 16:57:46 UTC (rev 
8022)
@@ -30,6 +30,8 @@
 import matplotlib.ticker as mticker
 import matplotlib.transforms as mtransforms
 
+from operator import itemgetter
+
 iterable = cbook.iterable
 is_string_like = cbook.is_string_like
 is_sequence_of_strings = cbook.is_sequence_of_strings
@@ -1698,11 +1700,22 @@
             artists.extend(self.spines.itervalues())
 
 
+
         dsu = [ (a.zorder, a) for a in artists
                 if not a.get_animated() ]
-        dsu.sort(key=lambda x: x[0])
 
 
+        # add images to dsu if the backend support compositing.
+        # otherwise, does the manaul compositing  without adding images to dsu.
+        if len(self.images)<=1 or renderer.option_image_nocomposite():
+            dsu.extend([(im.zorder, im) for im in self.images])
+            _do_composite = False
+        else:
+            _do_composite = True
+
+
+        dsu.sort(key=itemgetter(0))
+
         # rasterize artists with negative zorder
         # if the minimum zorder is negative, start rasterization
         rasterization_zorder = self._rasterization_zorder
@@ -1719,11 +1732,7 @@
         if self.axison and self._frameon:
             self.patch.draw(renderer)
 
-        if len(self.images)<=1 or renderer.option_image_nocomposite():
-            for im in self.images:
-                dsu.append( (im.zorder, im) )
-            dsu.sort(key=lambda x: x[0]) # re-sort with images now
-        else:
+        if _do_composite:
             # make a composite image blending alpha
             # list of (mimage.Image, ox, oy)
 


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

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to