Revision: 7145
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7145&view=rev
Author:   astraw
Date:     2009-05-27 16:25:33 +0000 (Wed, 27 May 2009)

Log Message:
-----------
make default argument to Axes.get_xaxis_transform() not raise error

I made this a separate commit from the previous one because it may be
useful to see the errors that arise if get_xaxis_transform() or
get_yaxis_transform() are called with no arguments. This would allow
one to figure out which code paths are calling these methods and fix
them if needed rather than silently partially succeeding.

Modified Paths:
--------------
    trunk/matplotlib/examples/api/custom_projection_example.py
    trunk/matplotlib/lib/matplotlib/axes.py
    trunk/matplotlib/lib/matplotlib/projections/geo.py
    trunk/matplotlib/lib/matplotlib/projections/polar.py

Modified: trunk/matplotlib/examples/api/custom_projection_example.py
===================================================================
--- trunk/matplotlib/examples/api/custom_projection_example.py  2009-05-27 
16:25:15 UTC (rev 7144)
+++ trunk/matplotlib/examples/api/custom_projection_example.py  2009-05-27 
16:25:33 UTC (rev 7145)
@@ -173,7 +173,7 @@
             yaxis_text_base + \
             Affine2D().translate(8.0, 0.0)
 
-    def get_xaxis_transform(self,which=None):
+    def get_xaxis_transform(self,which='grid'):
         """
         Override this method to provide a transformation for the
         x-axis grid and ticks.
@@ -199,7 +199,7 @@
         """
         return self._xaxis_text2_transform, 'top', 'center'
 
-    def get_yaxis_transform(self,which=None):
+    def get_yaxis_transform(self,which='grid'):
         """
         Override this method to provide a transformation for the
         y-axis grid and ticks.

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2009-05-27 16:25:15 UTC (rev 
7144)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2009-05-27 16:25:33 UTC (rev 
7145)
@@ -641,7 +641,7 @@
         self._yaxis_transform = mtransforms.blended_transform_factory(
                 self.transAxes, self.transData)
 
-    def get_xaxis_transform(self,which=None):
+    def get_xaxis_transform(self,which='grid'):
         """
         Get the transformation used for drawing x-axis labels, ticks
         and gridlines.  The x-direction is in data coordinates and the
@@ -712,7 +712,7 @@
                                               self.figure.dpi_scale_trans),
                 "bottom", "center")
 
-    def get_yaxis_transform(self,which=None):
+    def get_yaxis_transform(self,which='grid'):
         """
         Get the transformation used for drawing y-axis labels, ticks
         and gridlines.  The x-direction is in axis coordinates and the

Modified: trunk/matplotlib/lib/matplotlib/projections/geo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/geo.py  2009-05-27 16:25:15 UTC 
(rev 7144)
+++ trunk/matplotlib/lib/matplotlib/projections/geo.py  2009-05-27 16:25:33 UTC 
(rev 7145)
@@ -121,7 +121,7 @@
             .scale(0.5 / xscale, 0.5 / yscale) \
             .translate(0.5, 0.5)
 
-    def get_xaxis_transform(self,which=None):
+    def get_xaxis_transform(self,which='grid'):
         assert which in ['tick1','tick2','grid']
         return self._xaxis_transform
 
@@ -131,7 +131,7 @@
     def get_xaxis_text2_transform(self, pad):
         return self._xaxis_text2_transform, 'top', 'center'
 
-    def get_yaxis_transform(self,which=None):
+    def get_yaxis_transform(self,which='grid'):
         assert which in ['tick1','tick2','grid']
         return self._yaxis_transform
 

Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py        2009-05-27 
16:25:15 UTC (rev 7144)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py        2009-05-27 
16:25:33 UTC (rev 7145)
@@ -270,7 +270,7 @@
             self._yaxis_transform
             )
 
-    def get_xaxis_transform(self,which=None):
+    def get_xaxis_transform(self,which='grid'):
         assert which in ['tick1','tick2','grid']
         return self._xaxis_transform
 
@@ -280,7 +280,7 @@
     def get_xaxis_text2_transform(self, pad):
         return self._xaxis_text2_transform, 'center', 'center'
 
-    def get_yaxis_transform(self,which=None):
+    def get_yaxis_transform(self,which='grid'):
         assert which in ['tick1','tick2','grid']
         return self._yaxis_transform
 


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

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to