Changeset 46693050 in sasview for guitools/PlotPanel.py


Ignore:
Timestamp:
Apr 23, 2008 12:36:40 PM (16 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
863607a
Parents:
35891ce
Message:

working on fit linear

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guitools/PlotPanel.py

    r35891ce r46693050  
    6464        # keep track if the previous transformation of x and y in Property dialog 
    6565        self.prevXtrans =" " 
     66         
    6667        self.prevYtrans =" " 
    6768         
     
    343344                 
    344345            if (self.xscales=="log10(x)" ): 
    345                 item.transform_x( transform.toX, transform.errToLogX ) 
     346                item.transform_x( transform.toX, transform.errToX ) 
    346347                self.set_xscale("log") 
    347348                name, units = item.get_xaxis() 
     349                item.check_data_Plottable()  
    348350                self.graph.xaxis("Log10 %s" % name,  "%s^{-1}" % units) 
    349351                 
     
    364366                self.set_yscale("log")   
    365367                name, units = item.get_yaxis() 
     368                #item.check_data_Plottable()  
    366369                self.graph.yaxis("Log10 %s" % name,  "%s^{-1}" % units) 
    367370                 
     
    392395                 
    393396            if ( self.yscales =="ln(y*x^(2))"): 
    394                 item.transform_y( transform.toYX2 ,transform.errToLogYX2 ) 
     397                item.transform_y( transform.toLogYX2 ,transform.errToLogYX2 ) 
    395398                self.set_yscale("linear") 
    396399                yname, yunits = item.get_yaxis() 
     
    415418                self.set_yscale("linear") 
    416419                name, units = item.get_yaxis() 
    417                 self.graph.yaxis("Log %s" % name,  "%s^{-1}" % units) 
     420                self.graph.yaxis("$Log %s$" % name,  "%s^{-1}" % units) 
    418421        #item.name = self.yscales+" vs " +self.xscales       
    419422        self.prevXtrans = self.xscales  
     
    422425        self.graph.render(self) 
    423426        self.subplot.figure.canvas.draw_idle() 
    424     def onFitDisplay(self, plottable): 
     427         
     428    def onFitDisplay(self, plottable,xmin,xmax): 
    425429        """ 
    426430            Add a new plottable into the graph .In this case this plottable will be used  
     
    428432            @param plottable: the plottable to plot 
    429433        """ 
     434        list =[] 
     435        tempx=[] 
     436        tempy=[] 
     437        tempdx=[] 
     438        tempdy=[] 
     439        #Stored plotted plottable in a new plottable  
     440        list = self.graph.returnPlottable() 
     441        if len(list.keys())>0: 
     442            for item in list: 
     443                if self.graph.isPlotted(item)== True: 
     444                    x,y,dx,dy = item.returnValuesOfView() 
     445                    if((min(x) < xmin )and( max(x) > xmax ))\ 
     446                        or ((min(x) <= xmin )and( max(x) > xmax ))\ 
     447                        or((min(x) < xmin )and( max(x) >= xmax )): 
     448                        item.reducedXrange(xmin,xmax) 
     449                    else: 
     450                         item.originalXrange() 
     451             
     452         
     453        #Add the data to fit  
    430454        plottable.reset_view() 
    431455        self.graph.add(plottable) 
     
    434458        self.subplot.figure.canvas.draw_idle() 
    435459        self.graph.delete(plottable) 
     460     
    436461       
    437462     
Note: See TracChangeset for help on using the changeset viewer.