Changeset 0b16ee3 in sasview for guiframe/local_perspectives/plotting
- Timestamp:
- Apr 22, 2009 7:19:43 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:
- 4b26f8d9
- Parents:
- 7c3aea3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/Plotter1D.py
rbb5c1c7 r0b16ee3 223 223 224 224 if self.graph.selected_plottable in self.plots: 225 if self.plots[self.graph.selected_plottable].name in self.err_dy.iterkeys()\ 226 and self.errors_hide: 227 228 id = wx.NewId() 229 slicerpop.Append(id, '&Show errors to data') 230 wx.EVT_MENU(self, id, self._on_add_errors) 231 232 elif self.plots[self.graph.selected_plottable].__class__.__name__=="Data1D"\ 233 and not self.errors_hide: 225 selected_plot= self.plots[self.graph.selected_plottable] 226 #if self.plots[self.graph.selected_plottable].name in self.err_dy.iterkeys()\ 227 # and self.errors_hide: 228 if selected_plot.__class__.__name__=="Data1D": 229 if selected_plot.dy ==None or selected_plot.dy== []: 230 id = wx.NewId() 231 slicerpop.Append(id, '&Show errors to data') 232 wx.EVT_MENU(self, id, self._on_add_errors) 233 elif numpy.all(selected_plot.dy==0): 234 id = wx.NewId() 235 slicerpop.Append(id, '&Show errors to data') 236 wx.EVT_MENU(self, id, self._on_add_errors) 237 else: 234 238 id = wx.NewId() 235 239 slicerpop.Append(id, '&Hide Error bars') … … 272 276 import numpy 273 277 dy= numpy.zeros(len(self.plots[self.graph.selected_plottable].y)) 274 new_plot = Data1D(self.plots[self.graph.selected_plottable].x, 278 selected_plot= self.plots[self.graph.selected_plottable] 279 280 if selected_plot.__class__.__name__=="Data1D": 281 new_plot = Data1D(self.plots[self.graph.selected_plottable].x, 275 282 self.plots[self.graph.selected_plottable].y, 276 283 dy=dy) 284 else: 285 new_plot = Theory1D(self.plots[self.graph.selected_plottable].x, 286 self.plots[self.graph.selected_plottable].y, 287 dy=dy) 277 288 new_plot.interactive = True 278 289 self.errors_hide = True … … 292 303 self.graph.delete(self.plots[self.graph.selected_plottable]) 293 304 ## add newly created plottable to the graph with the save color 294 self.graph.color = color305 self.graph.color += color 295 306 self.graph.add(new_plot,color) 296 307 ## transforming the view of the new data into the same of the previous data … … 325 336 dy = numpy.zeros(length) 326 337 selected_plot= self.plots[self.graph.selected_plottable] 338 327 339 try: 328 340 dy = self.err_dy[selected_plot.name] 341 329 342 except: 330 343 #for i in range(length): 331 344 #dy[i] = math.sqrt(self.plots[self.graph.selected_plottable].y[i]) 332 dy= selected_plot.dy 345 if hasattr(selected_plot,"dy"): 346 dy= selected_plot.dy 347 else: 348 dy = numpy.zeros(selected_plot.dy) 349 333 350 ## Create a new plottable data1D 334 new_plot = Data1D(self.plots[self.graph.selected_plottable].x, 335 self.plots[self.graph.selected_plottable].y, 336 dy=dy) 351 if selected_plot.__class__.__name__=="Data1D": 352 new_plot = Data1D(self.plots[self.graph.selected_plottable].x, 353 self.plots[self.graph.selected_plottable].y, 354 dy=dy) 355 else: 356 ## Create a new plottable Theory1D 357 new_plot = Theory1D(self.plots[self.graph.selected_plottable].x, 358 self.plots[self.graph.selected_plottable].y, 359 dy=dy) 337 360 new_plot.interactive = True 338 361 … … 352 375 color=self.graph.plottables[self.plots[self.graph.selected_plottable]] 353 376 self.graph.delete(self.plots[self.graph.selected_plottable]) 354 self.graph.color = color377 self.graph.color += color 355 378 ## add newly created plottable to the graph with the save color 356 379 self.graph.add(new_plot, color)
Note: See TracChangeset
for help on using the changeset viewer.