Changeset 16d7079 in sasview


Ignore:
Timestamp:
Jan 17, 2011 1:08:54 PM (14 years ago)
Author:
Jae Cho <jhjcho@…>
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:
1b02da1d
Parents:
0d8642c9
Message:

Changed SLD unit for more user friendly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/profile_dialog.py

    r02879ea r16d7079  
    1  
    2  
    3  
     1""" 
     2SLD Profile Dialog for multifunctional models 
     3""" 
    44import wx 
    55import sys 
     
    1010import pylab 
    1111 
    12 DEFAULT_CMAP = pylab.cm.jet 
     12DEFAULT_CMAP = None#pylab.cm.jet 
    1313_BOX_WIDTH = 76 
    1414_STATICBOX_WIDTH = 400 
    15 _SCALE = 1e-6 
     15# X Y offset on plot 
     16_X_OFF = 15 
     17_Y_OFF = 0.5 
    1618 
    1719#SLD panel size  
     
    6365            data_plot = deepcopy(self.data) 
    6466            data_plot.dy = self._set_dy_data() 
     67            # unit increase to M times for users 
     68            data_plot.y = self._set_y_data() 
     69             
    6570            self.newplot = Theory1D(data_plot.x, data_plot.y, data_plot.dy) 
    6671            self.newplot.name = 'SLD' 
    6772            self.plotpanel.add_image(self.newplot)  
    68             self.Centre() 
     73            self.plotpanel.subplot.set_ylim(min(data_plot.y) - _Y_OFF ,  
     74                                                max(data_plot.y) + _Y_OFF) 
     75            self.plotpanel.subplot.set_xlim(min(data_plot.x) - _X_OFF,  
     76                                                max(data_plot.x) + _X_OFF) 
     77            #self.Centre() 
    6978            self.Layout() 
    7079 
     
    7887        dy = [0 for y in self.data.y] 
    7988        return dy       
     89 
     90    def _set_y_data(self):  
     91        """ 
     92        make y data unit Mega times 
     93         
     94        :return y_value:  
     95        """ 
     96        # changes the unit 
     97        y_value = [yvalue * 1e+006 for yvalue in self.data.y] 
     98         
     99        return y_value      
    80100     
    81101    def _setup_layout(self): 
     
    106126        self.Close(True) 
    107127 
    108     def _draw_model(self, event): 
    109         """ 
    110          on_close, update the model2d plot 
    111         """ 
    112         pass 
    113  
    114     def get_context_menu(self, graph=None): 
    115         """ 
    116         When the context menu of a plot is rendered, the  
    117         get_context_menu method will be called to give you a  
    118         chance to add a menu item to the context menu. 
    119         :param graph: the Graph object to which we attach the context menu 
    120          
    121         :return: a list of menu items with call-back function 
    122         """ 
    123         return [] 
     128 
    124129     
    125130 
     
    152157        self.plots[plot.name] = plot 
    153158        #init graph 
    154         self.gaph = Graph() 
     159        #self.gaph = Graph() 
    155160        #add plot 
    156161        self.graph.add(plot) 
     
    158163        x1_label = self.axes_label[0] 
    159164        self.graph.xaxis('\\rm{%s} '% x1_label, 'A') 
    160         self.graph.yaxis('\\rm{SLD} ', 'A^{-2}') 
     165        self.graph.yaxis('\\rm{SLD} ', '10^{-6}A^{-2}') 
    161166        #draw 
    162167        self.graph.render(self) 
     
    165170        # For latter scale changes  
    166171        self.plots[plot.name].xaxis('\\rm{%s} '% x1_label, 'A') 
    167         self.plots[plot.name].yaxis('\\rm{SLD} ', 'A^{-2}') 
    168  
     172        self.plots[plot.name].yaxis('\\rm{SLD} ', '10^{-6}A^{-2}') 
     173         
    169174    def on_set_focus(self, event): 
    170175        """ 
Note: See TracChangeset for help on using the changeset viewer.