Changeset 1c9419f4 in sasview for guiframe


Ignore:
Timestamp:
Oct 9, 2008 3:45:38 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:
2139c3f
Parents:
126a761
Message:

add togle scale on plotting module , allows loading data2D

Location:
guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_loader.py

    rfb8d4050 r1c9419f4  
    6262def plot_data(parent, path, name="Loaded Data"): 
    6363    from sans.guicomm.events import NewPlotEvent, StatusEvent 
     64    #from sans.guitools.plottables import Data1D, Theory1D 
     65    from danse.common.plottools.plottables import Data1D, Theory1D, Data2D 
    6466    from DataLoader.loader import  Loader 
     67    import numpy 
    6568    #Instantiate a loader  
    6669    L=Loader() 
     
    7275        wx.PostEvent(parent, StatusEvent(status="Problem loading file: %s" % sys.exc_value)) 
    7376        return 
    74          
    75     if type(output).__name__=='list': 
    76         for i in range(len(output)): 
    77             _plot_single_data(parent, output[i], path, name, str(i)) 
     77    if hasattr(data): 
     78        new_plot = Data2D(image= output.data) 
     79        new_plot.setValues(output) 
    7880    else: 
    79         _plot_single_data(parent, output, path, name) 
    80          
    81 def _plot_single_data(parent, output, path, name="Loaded Data", index=None): 
    82     """ 
    83         Plot a single data set 
    84         @param output: data set to plot 
    85     """ 
    86     from sans.guicomm.events import NewPlotEvent 
    87     from sans.guitools.plottables import Data1D, Theory1D 
    88      
    89     if output.dy==None: 
    90         new_plot = Theory1D(output.x, output.y) 
    91     else: 
    92         new_plot = Data1D(output.x, output.y, dy=output.dy) 
     81        if output.dy==None: 
     82            new_plot = Theory1D(output.x, output.y) 
     83        else: 
     84            new_plot = Data1D(output.x, output.y, dy=output.dy) 
    9385         
    9486    filename = os.path.basename(path) 
    95     if index is not None: 
    96         filename += "(%s)" % index 
    9787         
    9888    new_plot.name = name 
     
    10494    new_plot.group_id = filename 
    10595         
    106     title = filename 
    107     if len(output.title) > 0: 
    108         title = filename+'['+output.title+']' 
    109  
    110     wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=title)) 
     96    wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=filename)) 
  • guiframe/local_perspectives/plotting/plotting.py

    r925155f r1c9419f4  
    1212import wx 
    1313import sys 
    14 from sans.guitools.PlotPanel import PlotPanel 
    15 from sans.guitools.plottables import Graph 
     14#from sans.guitools.PlotPanel import PlotPanel 
     15import danse.common.plottools 
     16from danse.common.plottools.PlotPanel import PlotPanel 
     17#from sans.guitools.plottables import Graph 
     18from danse.common.plottools.plottables import Graph 
    1619from sans.guicomm.events import EVT_NEW_PLOT 
    1720 
     
    209212                slicerpop.Append(id, '&Linear fit') 
    210213                wx.EVT_MENU(self, id, self.onFitting) 
     214                 
     215        id = wx.NewId() 
     216        slicerpop.Append(id, '&Toggle Linear/Log scale') 
     217        wx.EVT_MENU(self, id,  self._onToggleScale) 
    211218 
    212219        id = wx.NewId() 
Note: See TracChangeset for help on using the changeset viewer.