Changeset fb59ed9 in sasview for theoryview/perspectives/theory/profile_dialog.py
- Timestamp:
- Oct 20, 2010 6:08:34 PM (14 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
theoryview/perspectives/theory/profile_dialog.py
ra1b2471 rfb59ed9 2 2 import sys 3 3 4 import copy,numpy4 from copy import deepcopy 5 5 from danse.common.plottools.PlotPanel import PlotPanel 6 6 from danse.common.plottools.plottables import Graph … … 17 17 if sys.platform.count("win32")>0: 18 18 _STATICBOX_WIDTH = 380 19 PANEL_SIZE = 4 2019 PANEL_SIZE = 475 20 20 FONT_VARIANT = 0 21 21 else: 22 22 _STATICBOX_WIDTH = 410 23 PANEL_SIZE = 45023 PANEL_SIZE = 505 24 24 FONT_VARIANT = 1 25 25 … … 36 36 ## Flag to tell the AUI manager to put this panel in the center pane 37 37 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): 39 39 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) 41 41 wx.Dialog.__init__(self, parent, id = id, *args, **kwds) 42 42 if data != None: … … 54 54 self.name = self.data.name 55 55 56 # Panel for 2Dplot57 self.plotpanel = SLDplotpanel(self, -1, style=wx.TRANSPARENT_WINDOW)56 # Panel for plot 57 self.plotpanel = SLDplotpanel(self, axes, -1, style=wx.TRANSPARENT_WINDOW) 58 58 self.cmap = DEFAULT_CMAP 59 59 ## Create Artist and bind it … … 61 61 62 62 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) 64 65 self.newplot.name = 'SLD' 65 66 self.plotpanel.add_image(self.newplot) … … 76 77 sizer = wx.GridBagSizer(14,14) 77 78 78 sizer.Add(self.plotpanel,(0, 0), (13, 13), wx.EXPAND | wx.LEFT| wx.RIGHT, 1 5)79 sizer.Add(self.plotpanel,(0, 0), (13, 13), wx.EXPAND | wx.LEFT| wx.RIGHT, 1) 79 80 80 81 #-----Button------------1 … … 110 111 Panel 111 112 """ 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): 113 114 """ 114 115 """ … … 120 121 self.plots = {} 121 122 self.graph = Graph() 122 123 123 self.axes_label = [] 124 for idx in range(0,len(axes)): 125 self.axes_label.append(axes[idx]) 124 126 125 127 def add_image(self, plot): … … 133 135 self.graph.add(plot) 134 136 #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') 136 139 self.graph.yaxis('\\rm{SLD} ', '\\AA^{-2}') 137 140
Note: See TracChangeset
for help on using the changeset viewer.