Hi All,I have addressed what I think is a long-standing wart: zorder is mostly ignored for imshow(). (See e.g. http://old.nabble.com/Re%3A--Matplotlib-users--imshow-zorder-tt19047314.html#a19047314 ) The question is whether I should apply the attached patch.
The worry is that someone is relying on the old behavior of images being underneath everything else. To a degree, this could be achieved by having the default image zorder be lower than everything else. Currently, imshow() creates images with zorder 1, which is pretty low on the hierarchy, but there may be something lower. (The artist base class default is 0, but the Line2D class bumps it to 2.) All tests pass with the change, and manual inspection of several of the pylab_examples don't show any difference before and after the patch.
-Andrew
diff --git a/lib/matplotlib/axes.py b/lib/matplotlib/axes.py index f628134..d23d1ce 100644 --- a/lib/matplotlib/axes.py +++ b/lib/matplotlib/axes.py @@ -1721,7 +1721,8 @@ class Axes(martist.Artist): if len(self.images)<=1 or renderer.option_image_nocomposite(): for im in self.images: - im.draw(renderer) + dsu.append( (im.zorder, len(dsu), im) ) + dsu.sort() # re-sort with images now else: # make a composite image blending alpha # list of (mimage.Image, ox, oy)
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel