Ignore:
Timestamp:
Oct 20, 2010 6:08:34 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:
d2539aa
Parents:
f118fe2f
Message:

added new models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • theoryview/perspectives/theory/profile_dialog.py

    ra1b2471 rfb59ed9  
    22import sys 
    33 
    4 import copy,numpy 
     4from copy import deepcopy 
    55from danse.common.plottools.PlotPanel import PlotPanel 
    66from danse.common.plottools.plottables import Graph 
     
    1717if sys.platform.count("win32")>0: 
    1818    _STATICBOX_WIDTH = 380 
    19     PANEL_SIZE = 420 
     19    PANEL_SIZE = 475 
    2020    FONT_VARIANT = 0 
    2121else: 
    2222    _STATICBOX_WIDTH = 410 
    23     PANEL_SIZE = 450 
     23    PANEL_SIZE = 505 
    2424    FONT_VARIANT = 1 
    2525     
     
    3636    ## Flag to tell the AUI manager to put this panel in the center pane 
    3737    CENTER_PANE = True 
    38     def __init__(self, parent=None,base=None,data =None, id = -1, *args, **kwds): 
     38    def __init__(self, parent=None,base=None,data =None,axes =['Radius'], id = -1, *args, **kwds): 
    3939        kwds["style"] =  wx.DEFAULT_DIALOG_STYLE 
    40         kwds["size"] = wx.Size(_STATICBOX_WIDTH*2,PANEL_SIZE)  
     40        kwds["size"] = wx.Size(_STATICBOX_WIDTH*1.5,PANEL_SIZE)  
    4141        wx.Dialog.__init__(self, parent, id = id,  *args, **kwds) 
    4242        if data != None: 
     
    5454            self.name = self.data.name 
    5555             
    56             # Panel for 2D plot 
    57             self.plotpanel    = SLDplotpanel(self, -1, style=wx.TRANSPARENT_WINDOW) 
     56            # Panel for plot 
     57            self.plotpanel    = SLDplotpanel(self, axes, -1, style=wx.TRANSPARENT_WINDOW) 
    5858            self.cmap = DEFAULT_CMAP 
    5959            ## Create Artist and bind it 
     
    6161 
    6262            self._setup_layout() 
    63             self.newplot=Theory1D(self.data.x,self.data.y) 
     63            data_plot = deepcopy(self.data) 
     64            self.newplot=Theory1D(data_plot.x,data_plot.y) 
    6465            self.newplot.name = 'SLD' 
    6566            self.plotpanel.add_image(self.newplot)  
     
    7677        sizer = wx.GridBagSizer(14,14) 
    7778         
    78         sizer.Add(self.plotpanel,(0, 0), (13, 13), wx.EXPAND | wx.LEFT| wx.RIGHT, 15) 
     79        sizer.Add(self.plotpanel,(0, 0), (13, 13), wx.EXPAND | wx.LEFT| wx.RIGHT, 1) 
    7980 
    8081        #-----Button------------1 
     
    110111    Panel 
    111112    """ 
    112     def __init__(self, parent, id = -1, color = None, dpi = None, **kwargs): 
     113    def __init__(self, parent,axes=[], id = -1, color = None, dpi = None, **kwargs): 
    113114        """ 
    114115        """ 
     
    120121        self.plots = {} 
    121122        self.graph = Graph() 
    122  
    123  
     123        self.axes_label = [] 
     124        for idx in range(0,len(axes)): 
     125            self.axes_label.append(axes[idx]) 
    124126          
    125127    def add_image(self, plot): 
     
    133135        self.graph.add(plot) 
    134136        #add axes 
    135         self.graph.xaxis('\\rm{Radius} ', '\\AA') 
     137        x1_label = self.axes_label[0] 
     138        self.graph.xaxis('\\rm{%s} '% x1_label, '\\AA') 
    136139        self.graph.yaxis('\\rm{SLD} ', '\\AA^{-2}') 
    137140 
Note: See TracChangeset for help on using the changeset viewer.