Revision: 8000
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8000&view=rev
Author:   efiring
Date:     2009-12-02 01:13:25 +0000 (Wed, 02 Dec 2009)

Log Message:
-----------
Draw artists with identical zorder in the order in which they were added.

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

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2009-12-01 19:09:10 UTC (rev 
7999)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2009-12-02 01:13:25 UTC (rev 
8000)
@@ -1700,10 +1700,10 @@
 
         dsu = [ (a.zorder, a) for a in artists
                 if not a.get_animated() ]
-        dsu.sort()
+        dsu.sort(key=lambda x: x[0])
 
 
-        # rasterze artists with negative zorder
+        # rasterize artists with negative zorder
         # if the minimum zorder is negative, start rasterization
         rasterization_zorder = self._rasterization_zorder
         if len(dsu) > 0 and dsu[0][0] < rasterization_zorder:
@@ -1722,15 +1722,15 @@
         if len(self.images)<=1 or renderer.option_image_nocomposite():
             for im in self.images:
                 dsu.append( (im.zorder, im) )
-            dsu.sort() # re-sort with images now
+            dsu.sort(key=lambda x: x[0]) # re-sort with images now
         else:
             # make a composite image blending alpha
             # list of (mimage.Image, ox, oy)
 
             zorder_images = [(im.zorder, im) for im in self.images \
                              if im.get_visible()]
-            zorder_images.sort()
-            
+            zorder_images.sort(key=lambda x: x[0])
+
             mag = renderer.get_image_magnification()
             ims = [(im.make_image(mag),0,0) for z,im in zorder_images]
 
@@ -1793,7 +1793,7 @@
         if self._lastRenderer is None:
             raise RuntimeError('You must first call ax.draw()')
         dsu = [(a.zorder, a) for a in self.animated.keys()]
-        dsu.sort()
+        dsu.sort(key=lambda x: x[0])
         renderer = self._lastRenderer
         renderer.blit()
         for tmp, a in dsu:

Modified: trunk/matplotlib/lib/matplotlib/figure.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/figure.py   2009-12-01 19:09:10 UTC (rev 
7999)
+++ trunk/matplotlib/lib/matplotlib/figure.py   2009-12-02 01:13:25 UTC (rev 
8000)
@@ -798,7 +798,7 @@
             dsu.append( (a.get_zorder(), a.draw, [renderer]))
 
 
-        dsu.sort()
+        dsu.sort(key=lambda x: x[0])
         for zorder, func, args in dsu:
             func(*args)
 


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

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to