- Timestamp:
- Dec 12, 2018 1:50:57 PM (6 years ago)
- Branches:
- master, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1249
- Children:
- 1342f6a
- Parents:
- 175b83f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/PlotPanel.py
r2469df7 r75313af 1434 1434 1435 1435 """ 1436 # TODO: include mask info in plotter 1436 1437 self.data = data 1437 1438 self.qx_data = qx_data … … 1451 1452 else: 1452 1453 output = copy.deepcopy(self.data) 1453 # check scale1454 # rescale data if necessary 1454 1455 if self.scale == 'log_{10}': 1455 try: 1456 if self.zmin_2D <= 0 and len(output[output > 0]) > 0: 1457 zmin_temp = self.zmin_2D 1458 output[output > 0] = np.log10(output[output > 0]) 1459 #In log scale Negative values are not correct in general 1460 #output[output<=0] = math.log(np.min(output[output>0])) 1461 elif self.zmin_2D <= 0: 1462 zmin_temp = self.zmin_2D 1463 output[output > 0] = np.zeros(len(output)) 1464 output[output <= 0] = -32 1465 else: 1466 zmin_temp = self.zmin_2D 1467 output[output > 0] = np.log10(output[output > 0]) 1468 #In log scale Negative values are not correct in general 1469 #output[output<=0] = math.log(np.min(output[output>0])) 1470 except: 1471 #Too many problems in 2D plot with scale 1472 pass 1473 1474 else: 1475 zmin_temp = self.zmin_2D 1456 with np.errstate(all='ignore'): 1457 output = np.log10(output) 1458 index = np.isfinite(output) 1459 if not index.all(): 1460 cutoff = (np.min(output[index]) - np.log10(2) 1461 if index.any() else 0.) 1462 output[~index] = cutoff 1463 # TODO: fix handling of zmin_2D/zmax_2D in _onToggleScale 1464 # For now, use default vmin/vmax from data 1465 #vmin, vmax = self.zmin_2D, self.zmax_2D 1466 vmin, vmax = None, None 1476 1467 self.cmap = cmap 1477 1468 if self.dimension != 3: 1478 1469 #Re-adjust colorbar 1479 1470 self.subplot.figure.subplots_adjust(left=0.2, right=.8, bottom=.2) 1480 1481 1471 im = self.subplot.imshow(output, interpolation='nearest', 1482 1472 origin='lower', 1483 vmin= zmin_temp, vmax=self.zmax_2D,1473 vmin=vmin, vmax=vmax, 1484 1474 cmap=self.cmap, 1485 1475 extent=(self.xmin_2D, self.xmax_2D,
Note: See TracChangeset
for help on using the changeset viewer.