Revision: 7188
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7188&view=rev
Author:   efiring
Date:     2009-06-06 18:21:51 +0000 (Sat, 06 Jun 2009)

Log Message:
-----------
Try to improve the cursor readout and status message.
This could be done better with changes to the backends.
The status (pan/zoom etc) should be indicated via the
state of the buttons, e.g. using radio buttons, rather
than by printing text.  The readout should be positioned
to minimize jumping around of the text.

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

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2009-06-06 18:18:54 UTC (rev 
7187)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2009-06-06 18:21:51 UTC (rev 
7188)
@@ -2468,12 +2468,14 @@
     def format_coord(self, x, y):
         'return a format string formatting the *x*, *y* coord'
         if x is None:
-            x = '???'
+            xs = '???'
+        else:
+            xs = self.format_xdata(x)
         if y is None:
-            y = '???'
-        xs = self.format_xdata(x)
-        ys = self.format_ydata(y)
-        return  'x=%s, y=%s'%(xs,ys)
+            ys = '???'
+        else:
+            ys = self.format_ydata(y)
+        return  'x=%s y=%s'%(xs,ys)
 
     #### Interactive manipulation
 

Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py    2009-06-06 18:18:54 UTC 
(rev 7187)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py    2009-06-06 18:21:51 UTC 
(rev 7188)
@@ -1460,7 +1460,7 @@
 
             restore_bbox = tight_bbox.adjust_bbox(self.figure, format,
                                                   bbox_inches)
-            
+
             _bbox_inches_restore = (bbox_inches, restore_bbox)
         else:
             _bbox_inches_restore = None
@@ -1896,7 +1896,7 @@
             except OverflowError: pass
             else:
                 if len(self.mode):
-                    self.set_message('%s : %s' % (self.mode, s))
+                    self.set_message('%s, %s' % (self.mode, s))
                 else:
                     self.set_message(s)
         else: self.set_message(self.mode)
@@ -1923,7 +1923,7 @@
                 'button_press_event', self.press_pan)
             self._idRelease = self.canvas.mpl_connect(
                 'button_release_event', self.release_pan)
-            self.mode = 'pan/zoom mode'
+            self.mode = 'pan/zoom'
             self.canvas.widgetlock(self)
         else:
             self.canvas.widgetlock.release(self)
@@ -2193,7 +2193,7 @@
         if  self._active:
             self._idPress = self.canvas.mpl_connect('button_press_event', 
self.press_zoom)
             self._idRelease = self.canvas.mpl_connect('button_release_event', 
self.release_zoom)
-            self.mode = 'Zoom to rect mode'
+            self.mode = 'zoom rect'
             self.canvas.widgetlock(self)
         else:
             self.canvas.widgetlock.release(self)

Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py   2009-06-06 18:18:54 UTC (rev 
7187)
+++ trunk/matplotlib/lib/matplotlib/ticker.py   2009-06-06 18:21:51 UTC (rev 
7188)
@@ -344,7 +344,7 @@
 
     def format_data_short(self,value):
         'return a short formatted string representation of a number'
-        return '%1.3g'%value
+        return '%-12g'%value
 
     def format_data(self,value):
         'return a formatted string representation of a number'
@@ -525,7 +525,7 @@
 
     def format_data_short(self,value):
         'return a short formatted string representation of a number'
-        return '%1.3g'%value
+        return '%-12g'%value
 
     def is_decade(self, x):
         n = self.nearest_long(x)


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

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to