- Timestamp:
- Oct 2, 2008 3:41:38 PM (16 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:
- 7d0c1a8
- Parents:
- cfbe9b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_loader.py
rc7bc3e7 rfb8d4050 62 62 def plot_data(parent, path, name="Loaded Data"): 63 63 from sans.guicomm.events import NewPlotEvent, StatusEvent 64 from sans.guitools.plottables import Data1D, Theory1D65 64 from DataLoader.loader import Loader 66 import numpy67 65 #Instantiate a loader 68 66 L=Loader() … … 75 73 return 76 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)) 78 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 77 89 if output.dy==None: 78 90 new_plot = Theory1D(output.x, output.y) … … 81 93 82 94 filename = os.path.basename(path) 95 if index is not None: 96 filename += "(%s)" % index 83 97 84 98 new_plot.name = name … … 90 104 new_plot.group_id = filename 91 105 92 wx.PostEvent(parent, NewPlotEvent(plot=new_plot, title=filename)) 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))
Note: See TracChangeset
for help on using the changeset viewer.