Revision: 4019
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4019&view=rev
Author:   mdboom
Date:     2007-10-26 11:32:44 -0700 (Fri, 26 Oct 2007)

Log Message:
-----------
Can't drag zoom on a polar plot.
Finessing Agg drawing quality a little bit.

Modified Paths:
--------------
    branches/transforms/lib/matplotlib/axes.py
    branches/transforms/lib/matplotlib/backend_bases.py
    branches/transforms/lib/matplotlib/projections/polar.py
    branches/transforms/src/_backend_agg.cpp

Modified: branches/transforms/lib/matplotlib/axes.py
===================================================================
--- branches/transforms/lib/matplotlib/axes.py  2007-10-26 18:04:51 UTC (rev 
4018)
+++ branches/transforms/lib/matplotlib/axes.py  2007-10-26 18:32:44 UTC (rev 
4019)
@@ -1820,6 +1820,12 @@
     
     #### Interactive manipulation
 
+    def can_zoom(self):
+        """
+        Return True if this axes support the zoom box
+        """
+        return True
+    
     def get_navigate(self):
         """
         Get whether the axes responds to navigation commands

Modified: branches/transforms/lib/matplotlib/backend_bases.py
===================================================================
--- branches/transforms/lib/matplotlib/backend_bases.py 2007-10-26 18:04:51 UTC 
(rev 4018)
+++ branches/transforms/lib/matplotlib/backend_bases.py 2007-10-26 18:32:44 UTC 
(rev 4019)
@@ -1361,7 +1361,8 @@
 
         self._xypress=[]
         for i, a in enumerate(self.canvas.figure.get_axes()):
-            if x is not None and y is not None and a.in_axes(event) and 
a.get_navigate():
+            if x is not None and y is not None and a.in_axes(event) \
+                    and a.get_navigate() and a.can_zoom():
                 self._xypress.append(( x, y, a, i, a.viewLim.frozen(), 
a.transData.frozen()))
 
         self.press(event)

Modified: branches/transforms/lib/matplotlib/projections/polar.py
===================================================================
--- branches/transforms/lib/matplotlib/projections/polar.py     2007-10-26 
18:04:51 UTC (rev 4018)
+++ branches/transforms/lib/matplotlib/projections/polar.py     2007-10-26 
18:32:44 UTC (rev 4019)
@@ -55,8 +55,11 @@
         transform_non_affine.__doc__ = Transform.transform_non_affine.__doc__
 
         def transform_path(self, path):
-            path = path.interpolated(self._resolution)
-            return Path(self.transform(path.vertices), path.codes)
+            vertices = path.vertices
+            if len(vertices) == 2 and vertices[0, 0] == vertices[1, 0]:
+                return Path(self.transform(vertices), path.codes)
+            ipath = path.interpolated(self._resolution)
+            return Path(self.transform(ipath.vertices), ipath.codes)
         transform_path.__doc__ = Transform.transform_path.__doc__
         
         transform_path_non_affine = transform_path
@@ -151,7 +154,7 @@
         def refresh(self):
             return self.base.refresh()
 
-    RESOLUTION = 50
+    RESOLUTION = 75
         
     def __init__(self, *args, **kwargs):
         """
@@ -377,6 +380,12 @@
         return 1.0
 
     ### Interactive panning
+
+    def can_zoom(self):
+        """
+        Return True if this axes support the zoom box
+        """
+        return False
     
     def start_pan(self, x, y, button):
         angle = self._r_label1_position.to_values()[4] / 180.0 * npy.pi

Modified: branches/transforms/src/_backend_agg.cpp
===================================================================
--- branches/transforms/src/_backend_agg.cpp    2007-10-26 18:04:51 UTC (rev 
4018)
+++ branches/transforms/src/_backend_agg.cpp    2007-10-26 18:32:44 UTC (rev 
4019)
@@ -95,8 +95,8 @@
   unsigned vertex(double* x, double* y) {
     unsigned cmd = m_source->vertex(x, y);
     if (m_quantize && agg::is_vertex(cmd)) {
-      *x = int(*x) + 0.5;
-      *y = int(*y) + 0.5;
+      *x = round(*x) + 0.5;
+      *y = round(*y) + 0.5;
     }
     return cmd;
   }
@@ -389,7 +389,7 @@
     }
 
     trans.transform(&x1, &y1);
-    if (!(fabs(x0 - x1) < 0.001 || fabs(y0 - y1) < 0.001)) {
+    if (!(fabs(x0 - x1) < 1e-4 || fabs(y0 - y1) < 1e-4)) {
       path.rewind(0);
       return false;
     }


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to