Changeset 5789654 in sasview for guitools/plottables.py


Ignore:
Timestamp:
Apr 7, 2008 6:31:09 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:
8742751
Parents:
fcaada5
Message:

modied fitdialog property dialog added fittings , modified plottables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guitools/plottables.py

    rf63f5ff r5789654  
    174174        if plottable in self.plottables: 
    175175            del self.plottables[plottable] 
     176        if self.color > 0: 
     177            self.color =  self.color -1 
     178        else: 
     179            self.color =0  
    176180 
    177181    def reset(self): 
     
    312316        self._yaxis = name 
    313317        self._yunit = units 
     318    def get_xaxis(self): 
     319        return self._xaxis, self._xunit 
     320    def get_yaxis(self): 
     321        return self._yaxis, self._yunit 
    314322 
    315323    @classmethod 
     
    336344    def __init__(self): 
    337345        self.view = View() 
     346        self._xaxis = "" 
     347        self._xunit = "" 
     348        self._yaxis = "" 
     349        self._yunit = ""  
     350         
    338351    def set_View(self,x,y): 
    339352        """ Load View  """ 
     
    345358        """ Reload view with new value to plot""" 
    346359        self.view = self.View(self.x, self.y, self.dx, self.dy) 
    347         print "the value of view x",self.view.x 
    348         print "the value of view y",self.view.y 
     360        
    349361        
    350362     
     
    379391        self.view.transform_y(func, errfunc, self.y, self.dy) 
    380392         
    381     def returnXvalueOfView(self): 
     393    def returnValuesOfView(self): 
    382394        return self.view.returnXview() 
    383395         
     
    449461                      
    450462        def returnXview(self): 
    451             return self.x 
     463            return self.x,self.y,self.dx,self.dy 
     464            
    452465      
    453466class Data1D(Plottable): 
     
    468481        self.dx = dx 
    469482        self.dy = dy 
    470          
     483        self.xaxis( 'q', 'A') 
     484        self.yaxis( 'intensity', 'cm') 
    471485        self.view = self.View(self.x, self.y, self.dx, self.dy) 
    472486         
     
    497511        The title is the name that will show up on the legend. 
    498512        """ 
     513        self.name= "theo" 
    499514        self.x = x 
    500515        self.y = y 
    501516        self.dy = dy 
    502         #Alina:added 
     517        
    503518        self.view = self.View(self.x, self.y, None, self.dy) 
    504519    def render(self,plot,**kw): 
     
    508523    def changed(self): 
    509524        return False 
    510  
     525    @classmethod 
     526    def labels(cls, collection): 
     527        """Build a label mostly unique within a collection""" 
     528        map = {} 
     529        for item in collection: 
     530            #map[item] = label(item, collection) 
     531            map[item] = r"$\rm{%s}$" % item.name 
     532        return map 
     533    
    511534 
    512535 
Note: See TracChangeset for help on using the changeset viewer.