Revision: 6106
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6106&view=rev
Author:   mdboom
Date:     2008-09-18 13:09:01 +0000 (Thu, 18 Sep 2008)

Log Message:
-----------
Fix interpolation in polar plots when theta values go negative.  Thanks Jan 
Gillis for reporting.

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/projections/polar.py

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2008-09-18 01:30:52 UTC (rev 6105)
+++ trunk/matplotlib/CHANGELOG  2008-09-18 13:09:01 UTC (rev 6106)
@@ -1,6 +1,8 @@
+2008-09-18 Fix polar interpolation to handle negative values of theta - MGD
+
 2008-09-14 Reorganized cbook and mlab methods related to numerical
           calculations that have little to do with the goals of those two
-          modules into a separate module numerical_methods.py 
+          modules into a separate module numerical_methods.py
           Also, added ability to select points and stop point selection
           with keyboard in ginput and manual contour labeling code.
           Finally, fixed contour labeling bug. - DMK

Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/projections/polar.py        2008-09-18 
01:30:52 UTC (rev 6105)
+++ trunk/matplotlib/lib/matplotlib/projections/polar.py        2008-09-18 
13:09:01 UTC (rev 6106)
@@ -56,6 +56,8 @@
 
         def transform_path(self, path):
             vertices = path.vertices
+            t = vertices[:, 0:1]
+            t[t != (npy.pi * 2.0)] %= (npy.pi * 2.0)
             if len(vertices) == 2 and vertices[0, 0] == vertices[1, 0]:
                 return Path(self.transform(vertices), path.codes)
             ipath = path.interpolated(self._resolution)
@@ -168,6 +170,7 @@
         """
 
         self._rpad = 0.05
+        self.resolution = kwargs.pop('resolution', self.RESOLUTION)
         Axes.__init__(self, *args, **kwargs)
         self.set_aspect('equal', adjustable='box', anchor='C')
         self.cla()
@@ -195,7 +198,7 @@
         self.transScale = TransformWrapper(IdentityTransform())
 
         # A (possibly non-linear) projection on the (already scaled) data
-        self.transProjection = self.PolarTransform(self.RESOLUTION)
+        self.transProjection = self.PolarTransform(self.resolution)
 
         # An affine transformation on the data, generally to limit the
         # range of the axes


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