Changeset d6d411d in sasview for guitools


Ignore:
Timestamp:
Jul 21, 2008 12:05:25 PM (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:
6aaf444
Parents:
be72312c
Message:

Bug fix

Location:
guitools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guitools/PlotPanel.py

    r8800ff6 rd6d411d  
    746746         
    747747        for item in list: 
    748             print item.name 
     748            print item.name, self.xLabel, item.get_xaxis() 
    749749            item.setLabel(self.xLabel,self.yLabel) 
    750750            if ( self.xLabel=="x" ): 
    751751                item.transformX(transform.toX,transform.errToX) 
    752752                name, units = item.get_xaxis() 
    753                 self.graph.xaxis("%s" % name,  "%s" % units) 
     753                self.graph._xaxis_transformed("%s" % name,  "%s" % units) 
    754754                 
    755755                 
     
    758758                name, units = item.get_xaxis() 
    759759                units=convertUnit(2,units)  
    760                 self.graph.xaxis("%s^{2}" % name,  "%s" % units) 
     760                self.graph._xaxis_transformed("%s^{2}" % name,  "%s" % units) 
    761761                 
    762762                 
     
    765765                _xscale = 'log' 
    766766                name, units = item.get_xaxis()  
    767                 self.graph.xaxis("\log_{10}\ \  (%s)" % name,  "%s" % units) 
     767                self.graph._xaxis_transformed("\log_{10}\ \  (%s)" % name,  "%s" % units) 
    768768                 
    769769                 
     
    771771                item.transformY(transform.toLogX,transform.errToLogX) 
    772772                name, units = item.get_yaxis() 
    773                 self.graph.yaxis("\log\ \ %s" % name,  "%s" % units) 
     773                self.graph._yaxis_transformed("\log\ \ %s" % name,  "%s" % units) 
    774774                 
    775775                 
     
    777777                item.transformY(transform.toX,transform.errToX) 
    778778                name, units = item.get_yaxis() 
    779                 self.graph.yaxis("%s" % name,  "%s" % units) 
     779                self.graph._yaxis_transformed("%s" % name,  "%s" % units) 
    780780                
    781781                 
     
    784784                _yscale = 'log'   
    785785                name, units = item.get_yaxis() 
    786                 self.graph.yaxis("\log_{10}\ \ (%s)" % name,  "%s" % units) 
     786                self.graph._yaxis_transformed("\log_{10}\ \ (%s)" % name,  "%s" % units) 
    787787                 
    788788                 
     
    791791                name, units = item.get_yaxis() 
    792792                units=convertUnit(2,units)  
    793                 self.graph.yaxis("%s^{2}" % name,  "%s" % units) 
     793                self.graph._yaxis_transformed("%s^{2}" % name,  "%s" % units) 
    794794                 
    795795                 
     
    798798                name, units = item.get_yaxis() 
    799799                units=convertUnit(-1,units) 
    800                 self.graph.yaxis("1/%s" % name,  "%s" % units) 
     800                self.graph._yaxis_transformed("1/%s" % name,  "%s" % units) 
    801801                 
    802802            if ( self.yLabel =="1/sqrt(y)" ): 
     
    804804                name, units = item.get_yaxis() 
    805805                units=convertUnit(-0.5,units) 
    806                 self.graph.yaxis("1/\sqrt{%s}" %name,  "%s" % units) 
     806                self.graph._yaxis_transformed("1/\sqrt{%s}" %name,  "%s" % units) 
    807807                 
    808808            if ( self.yLabel =="ln(y*x)"): 
     
    810810                yname, yunits = item.get_yaxis() 
    811811                xname, xunits = item.get_xaxis() 
    812                 self.graph.yaxis("\log\ (%s \ \ %s)" % (yname,xname),  "%s%s" % (yunits,xunits)) 
     812                self.graph._yaxis_transformed("\log\ (%s \ \ %s)" % (yname,xname),  "%s%s" % (yunits,xunits)) 
    813813                
    814814                 
     
    818818                xname, xunits = item.get_xaxis()  
    819819                xunits = convertUnit(2,xunits)  
    820                 self.graph.yaxis("\log (%s \ \ %s^{2})" % (yname,xname),  "%s%s" % (yunits,xunits)) 
     820                self.graph._yaxis_transformed("\log (%s \ \ %s^{2})" % (yname,xname),  "%s%s" % (yunits,xunits)) 
    821821                 
    822822             
     
    826826                xname, xunits = item.get_xaxis() 
    827827                xunits = convertUnit(4,xunits)  
    828                 self.graph.yaxis("\log (%s \ \ %s^{4})" % (yname,xname),  "%s%s" % (yunits,xunits)) 
     828                self.graph._yaxis_transformed("\log (%s \ \ %s^{4})" % (yname,xname),  "%s%s" % (yunits,xunits)) 
    829829                 
    830830            if ( self.viewModel == "Guinier lny vs x^(2)"): 
     
    833833                name, units = item.get_xaxis() 
    834834                units = convertUnit(2,units)  
    835                 self.graph.xaxis("%s^{2}" % name,  "%s" % units) 
     835                self.graph._xaxis_transformed("%s^{2}" % name,  "%s" % units) 
    836836                 
    837837                 
    838838                item.transformY(transform.toLogX,transform.errToLogX ) 
    839839                name, units = item.get_yaxis() 
    840                 self.graph.yaxis("\log\ \ %s" % name,  "%s" % units) 
     840                self.graph._yaxis_transformed("\log\ \ %s" % name,  "%s" % units) 
    841841                
    842842                 
  • guitools/plottables.py

    ra17ffdf rd6d411d  
    116116    would be nice. 
    117117    """ 
     118    def _xaxis_transformed(self, name, units): 
     119        """ 
     120            Change the property of the x axis 
     121            according to an axis transformation 
     122            (as opposed to changing the basic properties) 
     123        """ 
     124        self.prop["xlabel"] = "%s (%s)"%(name,units) 
     125        self.prop["xunit"] = units 
     126         
     127    def _yaxis_transformed(self, name, units): 
     128        """ 
     129            Change the property of the y axis 
     130            according to an axis transformation 
     131            (as opposed to changing the basic properties) 
     132        """ 
     133        self.prop["ylabel"] = "%s (%s)"%(name,units) 
     134        self.prop["yunit"] = units 
     135         
    118136    def xaxis(self,name,units): 
    119137        """Properties of the x axis. 
    120138        """ 
    121         if self.prop["xunit"] and units != self.prop["xunit"]: 
    122             pass 
    123             #print "Plottable: how do we handle non-commensurate units" 
    124139        self.prop["xlabel"] = "%s (%s)"%(name,units) 
    125140        self.prop["xunit"] = units 
     141        self.prop["xlabel_base"] = "%s (%s)"%(name,units) 
     142        self.prop["xunit_base"] = units 
    126143 
    127144    def yaxis(self,name,units): 
    128145        """Properties of the y axis. 
    129146        """ 
    130         if self.prop["yunit"] and units != self.prop["yunit"]: 
    131             pass 
    132             #print "Plottable: how do we handle non-commensurate units" 
    133147        self.prop["ylabel"] = "%s (%s)"%(name,units) 
    134148        self.prop["yunit"] = units 
     149        self.prop["ylabel_base"] = "%s (%s)"%(name,units) 
     150        self.prop["yunit_base"] = units 
    135151         
    136152    def title(self,name): 
Note: See TracChangeset for help on using the changeset viewer.