- Timestamp:
- Mar 31, 2008 2:45:13 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:
- e40b651
- Parents:
- 6b8399b
- Location:
- guitools
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/plottables.py
r057210c r6cfe703 199 199 200 200 return labels 201 def returnPlottable(self): 202 return self.plottables 201 203 202 204 def render(self,plot): … … 332 334 333 335 def __init__(self): 334 pass336 self.view = View() 335 337 336 338 def render(self,plot): … … 342 344 that it makes sense. 343 345 """ 344 plot.xaxis(self._xaxis, self._xunit) 345 plot.yaxis(self._yaxis, self._yunit) 346 self.view.render() 347 #plot.xaxis(self._xaxis, self._xunit) 348 #plot.yaxis(self._yaxis, self._yunit) 346 349 347 350 def colors(self): 348 351 """Return the number of colors need to render the object""" 349 352 return 1 353 354 def transform_x(self, func, errfunc): 355 """ 356 @param func: reference to x transformation function 357 358 """ 359 self.view.transform_x(func, errfunc, self.x, self.dx) 360 361 def transform_y(self, func, errfunc): 362 """ 363 @param func: reference to y transformation function 364 365 """ 366 self.view.transform_y(func, errfunc, self.y, self.dy) 350 367 351 368 class View: … … 378 395 raise ValueError, "Plottable.View: Given x and dx are not of the same length" 379 396 380 self.x = deepcopy(x)381 self.dx = deepcopy(dx)397 self.x = copy.deepcopy(x) 398 self.dx = copy.deepcopy(dx) 382 399 383 400 for i in range(len(x)): 384 401 self.x[i] = func(x[i]) 385 402 self.dx[i] = errfunc(dx[i]) 386 403 387 404 def transform_y(self, func, errfunc, y, dy): 388 405 """ … … 405 422 self.y[i] = func(y[i]) 406 423 self.dy[i] = errfunc(dy[i]) 407 408 424 def render(self,plot): 425 """The base class makes sure the correct units are being used for 426 subsequent plottable. 427 428 For now it is assumed that the graphs are commensurate, and if you 429 put a Qx object on a Temperature graph then you had better hope 430 that it makes sense. 431 """ 432 plot.xaxis(self._xaxis, self._xunit) 433 plot.yaxis(self._yaxis, self._yunit) 434 435 409 436 410 437 class Data1D(Plottable):
Note: See TracChangeset
for help on using the changeset viewer.