Changeset 43bf807 in sasview


Ignore:
Timestamp:
Jun 6, 2008 11:14:47 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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
Message:

Fixed labels in PlotPanel? and minor mod for sqrt units in unitConverter.

Location:
guitools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guitools/PlotPanel.py

    r052a66bc r43bf807  
    2727    if 'get_children' in dir(obj): 
    2828        for a in obj.get_children(): show_tree(a,d+1) 
    29          
    30 def convertUnit(pow,unit): 
     29      
     30from unitConverter import UnitConvertion as convertUnit    
     31def _convertUnit(pow,unit): 
    3132    """  
    3233        Displays the unit with the proper convertion 
     
    4849    #print"this is unit",unit 
    4950    return unit 
     51 
    5052def _rescale(lo,hi,step,pt=None,bal=None,scale='linear'): 
    5153        """ 
     
    606608                self.set_yscale("linear") 
    607609                name, units = item.get_yaxis() 
    608                 units=convertUnit(-1,units) 
     610                units=convertUnit(-0.5,units) 
    609611                self.graph.yaxis("1/\sqrt{%s}" %name,  "%s" % units) 
    610612                 
     
    623625                xname, xunits = item.get_xaxis()  
    624626                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)) 
    626628                 
    627629             
     
    632634                xname, xunits = item.get_xaxis() 
    633635                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)) 
    635637                 
    636638            if ( self.viewModel == "Guinier lny vs x^(2)"): 
  • guitools/unitConverter.py

    r3dd29e3 r43bf807  
    4141                        if power==1.0: 
    4242                           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}"   
    4347                        else: 
    4448                            unit= unitSplitted[0]+"^{"+str(power)+"}"   
Note: See TracChangeset for help on using the changeset viewer.