Changeset 52b1f77 in sasview for guitools/plottables.py
- Timestamp:
- Apr 1, 2008 2:27:52 PM (17 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:
- f79b054
- Parents:
- 8e4516f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/plottables.py
r8e4516f r52b1f77 199 199 200 200 return labels 201 201 202 def returnPlottable(self): 202 203 return self.plottables … … 335 336 def __init__(self): 336 337 self.view = View() 338 def set_View(self,x,y): 339 self.x= x 340 self.y = y 341 self.dx= x 342 self.dy = y 343 self.reset_view() 344 345 def reset_view(self): 346 self.view = self.View(self.x, self.y, self.dx, self.dy) 337 347 338 348 def render(self,plot): … … 344 354 that it makes sense. 345 355 """ 346 356 347 357 plot.xaxis(self._xaxis, self._xunit) 348 358 plot.yaxis(self._yaxis, self._yunit) … … 400 410 for i in range(len(x)): 401 411 self.x[i] = func(x[i]) 412 for i in range(len(dx)): 402 413 self.dx[i] = errfunc(dx[i]) 403 414 … … 416 427 raise ValueError, "Plottable.View: Given y and dy are not of the same length" 417 428 418 self.y = deepcopy(y)419 self.dy = deepcopy(dy)429 self.y = copy.deepcopy(y) 430 self.dy = copy.deepcopy(dy) 420 431 421 432 for i in range(len(y)): 422 433 self.y[i] = func(y[i]) 434 for i in range(len(dy)): 423 435 self.dy[i] = errfunc(dy[i]) 424 425 426 436 427 437 class Data1D(Plottable): 428 438 """Data plottable: scatter plot of x,y with errors in x and y. … … 444 454 445 455 self.view = self.View(self.x, self.y, self.dx, self.dy) 446 456 447 457 def render(self,plot,**kw): 448 458 plot.points(self.view.x,self.view.y,dx=self.view.dx,dy=self.view.dy,**kw) 449 459 450 460 def changed(self): 451 461 return False … … 524 534 graph.add(Theory1D(x,y,dy=dy)) 525 535 526 return graph 536 return graph 527 537 528 538 def demo_plotter(graph):
Note: See TracChangeset
for help on using the changeset viewer.