Revision: 6360
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6360&view=rev
Author:   jrevans
Date:     2008-10-31 14:54:42 +0000 (Fri, 31 Oct 2008)

Log Message:
-----------
Added unit handling for axhspan and axvspan.

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

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2008-10-31 13:06:59 UTC (rev 
6359)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2008-10-31 14:54:42 UTC (rev 
6360)
@@ -2876,9 +2876,16 @@
         .. plot:: mpl_examples/pylab_examples/axhspan_demo.py
 
         """
-        # convert y axis units
         trans = mtransforms.blended_transform_factory(
             self.transAxes, self.transData)
+
+        # process the unit information
+        self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs )
+
+        # first we need to strip away the units
+        xmin, xmax = self.convert_xunits( [xmin, xmax] )
+        ymin, ymax = self.convert_yunits( [ymin, ymax] )
+
         verts = (xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)
         p = mpatches.Polygon(verts, **kwargs)
         p.set_transform(trans)
@@ -2923,9 +2930,16 @@
             :meth:`axhspan`:
                 for example plot and source code
         """
-        # convert x axis units
         trans = mtransforms.blended_transform_factory(
             self.transData, self.transAxes)
+
+        # process the unit information
+        self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs )
+
+        # first we need to strip away the units
+        xmin, xmax = self.convert_xunits( [xmin, xmax] )
+        ymin, ymax = self.convert_yunits( [ymin, ymax] )
+
         verts = [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)]
         p = mpatches.Polygon(verts, **kwargs)
         p.set_transform(trans)


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