Changeset 43bf807 in sasview
- Timestamp:
- Jun 6, 2008 11:14:47 AM (17 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:
- 0be5c81
- Parents:
- 3dd29e3
- Location:
- guitools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
r052a66bc r43bf807 27 27 if 'get_children' in dir(obj): 28 28 for a in obj.get_children(): show_tree(a,d+1) 29 30 def convertUnit(pow,unit): 29 30 from unitConverter import UnitConvertion as convertUnit 31 def _convertUnit(pow,unit): 31 32 """ 32 33 Displays the unit with the proper convertion … … 48 49 #print"this is unit",unit 49 50 return unit 51 50 52 def _rescale(lo,hi,step,pt=None,bal=None,scale='linear'): 51 53 """ … … 606 608 self.set_yscale("linear") 607 609 name, units = item.get_yaxis() 608 units=convertUnit(- 1,units)610 units=convertUnit(-0.5,units) 609 611 self.graph.yaxis("1/\sqrt{%s}" %name, "%s" % units) 610 612 … … 623 625 xname, xunits = item.get_xaxis() 624 626 xunits = convertUnit(2,xunits) 625 self.graph.yaxis("Log (%s \ \ %s )" % (yname,xname), "%s%s" % (yunits,xunits))627 self.graph.yaxis("Log (%s \ \ %s^{2})" % (yname,xname), "%s%s" % (yunits,xunits)) 626 628 627 629 … … 632 634 xname, xunits = item.get_xaxis() 633 635 xunits = convertUnit(4,xunits) 634 self.graph.yaxis("Log (%s \ \ %s )" % (yname,xname), "%s%s" % (yunits,xunits))636 self.graph.yaxis("Log (%s \ \ %s^{4})" % (yname,xname), "%s%s" % (yunits,xunits)) 635 637 636 638 if ( self.viewModel == "Guinier lny vs x^(2)"): -
guitools/unitConverter.py
r3dd29e3 r43bf807 41 41 if power==1.0: 42 42 unit = unitSplitted[0] 43 elif power==0.5: 44 unit = unitSplitted[0]+"^{1/2}" 45 elif power==-0.5: 46 unit = unitSplitted[0]+"^{-1/2}" 43 47 else: 44 48 unit= unitSplitted[0]+"^{"+str(power)+"}"
Note: See TracChangeset
for help on using the changeset viewer.