Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Plotter2D.py

    rc30822c r8db20a9  
    330330        self.manager.communicator.plotUpdateSignal.emit([new_plot]) 
    331331 
     332        self.manager.communicator.forcePlotDisplaySignal.emit([item, new_plot]) 
     333 
     334        # Show the plot 
     335 
    332336    def setSlicer(self, slicer): 
    333337        """ 
     
    464468        # check scale 
    465469        if self.scale == 'log_{10}': 
    466             try: 
    467                 if  self.zmin is None  and len(output[output > 0]) > 0: 
    468                     zmin_temp = self.zmin 
    469                     output[output > 0] = numpy.log10(output[output > 0]) 
    470                 elif self.zmin <= 0: 
    471                     zmin_temp = self.zmin 
    472                     output[output > 0] = numpy.zeros(len(output)) 
    473                     output[output <= 0] = MIN_Z 
    474                 else: 
    475                     zmin_temp = self.zmin 
    476                     output[output > 0] = numpy.log10(output[output > 0]) 
    477             except: 
    478                 #Too many problems in 2D plot with scale 
    479                 pass 
     470            with numpy.errstate(all='ignore'): 
     471                output = numpy.log10(output) 
     472            index = numpy.isfinite(output) 
     473            if not index.all(): 
     474                cutoff = (numpy.quantile(output[index], 0.05) - numpy.log10(2) if index.any() else 0.) 
     475                output[output < cutoff] = cutoff 
     476                output[~index] = cutoff 
     477        vmin, vmax = None, None 
    480478 
    481479        self.cmap = cmap 
Note: See TracChangeset for help on using the changeset viewer.