- Timestamp:
- Sep 29, 2008 11:01:08 AM (16 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- a9e04aa
- Parents:
- 65b788b2
- Location:
- guitools
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
rc87d55a r3755d77 1 1 import wx.lib.newevent 2 import matplotlib 2 try: 3 import matplotlib 4 except: 5 import pkg_resources 6 pkg_resources.require("matplotlib<0.92.0") 7 import matplotlib 8 3 9 matplotlib.interactive(False) 4 10 #Use the WxAgg back end. The Wx one takes too long to render -
guitools/fitDialog.py
r4ab1c91 r3755d77 205 205 self.x,self.y,self.dx,self.dy= self.plottable.returnValuesOfView() 206 206 207 self.mini =min(self.x) 208 self.maxi =max(self.x) 209 207 #self.mini =min(self.x) 208 #self.maxi =max(self.x) 209 210 try: 211 self.mini = self.floatForwardTransform(min(self.x)) 212 except: 213 self.mini = "Invalid" 214 try: 215 self.maxi = self.floatForwardTransform(max(self.x)) 216 except: 217 self.maxi = "Invalid" 210 218 211 219 self.initXmin.SetValue(format_number(min(self.plottable.x))) … … 381 389 if float(usermin) < float(usermax): 382 390 if float(usermin) >= float(self.mini) and float(usermin) < float(self.maxi): 383 self.xminFit.SetValue(format_number( usermin))391 self.xminFit.SetValue(format_number(float(usermin))) 384 392 else: 385 self.xminFit.SetValue(format_number( self.mini))393 self.xminFit.SetValue(format_number(float(self.mini))) 386 394 387 395 if float(usermax) > float(self.mini) and float(usermax) <= float(self.maxi): 388 self.xmaxFit.SetLabel(format_number( usermax))396 self.xmaxFit.SetLabel(format_number(float(usermax))) 389 397 else: 390 self.xmaxFit.SetLabel(format_number( self.maxi))398 self.xmaxFit.SetLabel(format_number(float(self.maxi))) 391 399 392 400 mini =float(self.xminFit.GetValue()) … … 394 402 395 403 return mini, maxi 404 405 def floatForwardTransform(self,x): 406 """ 407 transform a float. 408 """ 409 #TODO: refactor this with proper object-oriented design 410 # This code stinks. 411 412 if ( self.xLabel=="x" ): 413 return transform.toX(x) 414 415 if ( self.xLabel=="x^(2)" ): 416 return transform.toX2(x) 417 418 if (self.xLabel=="log10(x)" ): 419 return math.log10(x) 420 396 421 def floatTransform(self,x): 397 422 """ … … 427 452 428 453 elif (self.xLabel=="log10(x)" ): 429 print "fitdialog: x",x430 454 return math.pow(10, x) 431 455
Note: See TracChangeset
for help on using the changeset viewer.