- Timestamp:
- Apr 1, 2008 3:24:24 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:
- e2914b1
- Parents:
- 52b1f77
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/plottables.py
r52b1f77 rf79b054 401 401 """ 402 402 import copy 403 import numpy 403 404 # Sanity check 404 405 if dx and not len(x)==len(dx): 405 406 raise ValueError, "Plottable.View: Given x and dx are not of the same length" 406 407 407 self.x = copy.deepcopy(x) 408 self.dx = copy.deepcopy(dx) 408 409 self.x = numpy.zeros(len(x)) 410 self.dx = numpy.zeros(len(x)) 409 411 410 412 for i in range(len(x)): 411 413 self.x[i] = func(x[i]) 412 for i in range(len(dx)): 413 self.dx[i] = errfunc(dx[i]) 414 self.dx[i] = errfunc(x[i], dx[i]) 414 415 415 416 def transform_y(self, func, errfunc, y, dy): … … 427 428 raise ValueError, "Plottable.View: Given y and dy are not of the same length" 428 429 429 self.y = copy.deepcopy(y)430 self.dy = copy.deepcopy(dy)431 430 self.y = numpy.zeros(len(y)) 431 self.dy = numpy.zeros(len(y)) 432 432 433 for i in range(len(y)): 433 434 self.y[i] = func(y[i]) 434 for i in range(len(dy)): 435 self.dy[i] = errfunc(dy[i]) 435 self.dy[i] = errfunc(y[i], dy[i]) 436 436 437 437 class Data1D(Plottable): … … 457 457 def render(self,plot,**kw): 458 458 plot.points(self.view.x,self.view.y,dx=self.view.dx,dy=self.view.dy,**kw) 459 #plot.points(self.x,self.y,dx=self.dx,dy=self.dy,**kw) 459 460 460 461 def changed(self):
Note: See TracChangeset
for help on using the changeset viewer.