Changes in / [0a924c6:f58a13a] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/PlotPanel.py
r75313af r2469df7 1434 1434 1435 1435 """ 1436 # TODO: include mask info in plotter1437 1436 self.data = data 1438 1437 self.qx_data = qx_data … … 1452 1451 else: 1453 1452 output = copy.deepcopy(self.data) 1454 # rescale data if necessary1453 # check scale 1455 1454 if self.scale == 'log_{10}': 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 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 1467 1476 self.cmap = cmap 1468 1477 if self.dimension != 3: 1469 1478 #Re-adjust colorbar 1470 1479 self.subplot.figure.subplots_adjust(left=0.2, right=.8, bottom=.2) 1480 1471 1481 im = self.subplot.imshow(output, interpolation='nearest', 1472 1482 origin='lower', 1473 vmin= vmin, vmax=vmax,1483 vmin=zmin_temp, vmax=self.zmax_2D, 1474 1484 cmap=self.cmap, 1475 1485 extent=(self.xmin_2D, self.xmax_2D,
Note: See TracChangeset
for help on using the changeset viewer.