Merged with trunk
[hooke.git] / hooke / hooke.py
index 75cc7d9fff89a3d3c3a3813a42beb8f969b452b1..5fbc40bcd85cc0820df950e7ddab8c3c9151ee65 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python\r
+# -*- coding: utf-8 -*-\r
 \r
 '''\r
 HOOKE - A force spectroscopy review & analysis tool\r
@@ -269,6 +270,11 @@ class MainWindow(wx.Frame):
         self.figures=[control.get_figure() for control in self.controls]\r
         self.axes=[figure.gca() for figure in self.figures]\r
 \r
+       for i in range(len(self.axes)):\r
+         self.axes[i].xaxis.set_major_formatter(EngrFormatter())\r
+         self.axes[i].yaxis.set_major_formatter(EngrFormatter(2))\r
+\r
+\r
         self.cpanels[1].Hide()\r
         self.mainpanel.splitter.Initialize(self.cpanels[0])\r
 \r
@@ -550,6 +556,11 @@ class MainWindow(wx.Frame):
                 ylim=self.axes[dest].get_ylim()        \r
                 self.axes[dest].set_ylim((ylim[1],ylim[0])) \r
 \r
+           for i in range(len(self.axes)):\r
+             self.axes[i].xaxis.set_major_formatter(EngrFormatter())\r
+             self.axes[i].yaxis.set_major_formatter(EngrFormatter(2))\r
+\r
+\r
             self.controls[dest].draw()\r
 \r
 \r
@@ -687,12 +698,15 @@ class MainWindow(wx.Frame):
             '''\r
         if dest==None:\r
             dest=self.current_plot_dest\r
-\r
-        plot=None\r
-        for aplot in self.plots:\r
-            if aplot.destination == dest:\r
-                plot=aplot\r
-        return plot\r
+        try:\r
+          plot=None\r
+          for aplot in self.plots:\r
+              if aplot.destination == dest:\r
+                  plot=aplot\r
+          return plot\r
+        except:\r
+           print "No curve available"\r
+           return None\r
 \r
     def _replot(self):\r
         '''\r