Changeset ca58654 in sasview for plottools/src/danse
- Timestamp:
- Jan 19, 2012 4:47:10 PM (13 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:
- e25d908
- Parents:
- 4310dbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plottools/src/danse/common/plottools/PlotPanel.py
r7434020 rca58654 117 117 """ 118 118 def __init__(self, parent, id=-1, xtransform=None, 119 ytransform=None, scale='log ',119 ytransform=None, scale='log_{10}', 120 120 color=None, dpi=None, **kwargs): 121 121 """ … … 226 226 # for 2D scale 227 227 if scale != 'linear': 228 scale = 'log '228 scale = 'log_{10}' 229 229 self.scale = scale 230 230 self.data = None … … 1402 1402 zmin_2D_temp = self.zmin_2D 1403 1403 zmax_2D_temp = self.zmax_2D 1404 if self.scale == 'log ':1404 if self.scale == 'log_{10}': 1405 1405 self.scale = 'linear' 1406 1406 if not self.zmin_2D is None: 1407 zmin_2D_temp = math. exp(self.zmin_2D)1407 zmin_2D_temp = math.pow(10, self.zmin_2D) 1408 1408 if not self.zmax_2D is None: 1409 zmax_2D_temp = math. exp(self.zmax_2D)1409 zmax_2D_temp = math.pow(10, self.zmax_2D) 1410 1410 else: 1411 self.scale = 'log '1411 self.scale = 'log_{10}' 1412 1412 if not self.zmin_2D is None: 1413 1413 # min log value: no log(negative) … … 1415 1415 zmin_2D_temp = -32 1416 1416 else: 1417 zmin_2D_temp = math.log (self.zmin_2D)1417 zmin_2D_temp = math.log10(self.zmin_2D) 1418 1418 if not self.zmax_2D is None: 1419 zmax_2D_temp = math.log (self.zmax_2D)1419 zmax_2D_temp = math.log10(self.zmax_2D) 1420 1420 1421 1421 self.image(data=self.data, qx_data=self.qx_data, … … 1450 1450 output = copy.deepcopy(self.data) 1451 1451 # check scale 1452 if self.scale == 'log ':1452 if self.scale == 'log_{10}': 1453 1453 try: 1454 1454 if self.zmin_2D <= 0 and len(output[output > 0]) > 0: 1455 1455 zmin_temp = self.zmin_2D 1456 output[output>0] = numpy.log (output[output>0])1456 output[output>0] = numpy.log10(output[output>0]) 1457 1457 #In log scale Negative values are not correct in general 1458 1458 #output[output<=0] = math.log(numpy.min(output[output>0])) … … 1463 1463 else: 1464 1464 zmin_temp = self.zmin_2D 1465 output[output>0] = numpy.log (output[output>0])1465 output[output>0] = numpy.log10(output[output>0]) 1466 1466 #In log scale Negative values are not correct in general 1467 1467 #output[output<=0] = math.log(numpy.min(output[output>0])) … … 1479 1479 im = self.subplot.imshow(output, interpolation='nearest', 1480 1480 origin='lower', 1481 vmin=zmin_temp, vmax=self.zmax_2D,1482 cmap=self.cmap ,1483 extent=(self.xmin_2D, self.xmax_2D,1484 self.ymin_2D, self.ymax_2D))1481 #vmin=zmin_temp, vmax=self.zmax_2D, 1482 cmap=self.cmap)#, 1483 #extent=(self.xmin_2D, self.xmax_2D, 1484 # self.ymin_2D, self.ymax_2D)) 1485 1485 cbax = self.subplot.figure.add_axes([0.84,0.2,0.02,0.7]) 1486 1486 else: … … 1513 1513 cb =self.subplot.figure.colorbar(im, cax=cbax) 1514 1514 cb.update_bruteforce(im) 1515 cb.set_label( self.scale)1515 cb.set_label('$' + self.scale + '$') 1516 1516 1517 1517 #if self.dimension != 3:
Note: See TracChangeset
for help on using the changeset viewer.