Changeset bb57068 in sasview for src


Ignore:
Timestamp:
Apr 5, 2018 5:46:18 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
d6e38661
Parents:
3790f7f
Message:

Corrected plot scale for residuals

Location:
src/sas/qtgui
Files:
2 edited

Legend:

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

    reb1a386 rbb57068  
    1313from sas.qtgui.Plotting.LinearFit import LinearFit 
    1414from sas.qtgui.Plotting.PlotProperties import PlotProperties 
     15from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 
    1516 
    1617import sas.qtgui.Utilities.GuiUtils as GuiUtils 
     
    7475        is_fit = (self.data.id=="fit") 
    7576 
     77        # make sure we have some function to operate on 
     78        if self.data.xtransform is None: 
     79            self.data.xtransform = 'log10(x)' 
     80        if self.data.ytransform is None: 
     81            self.data.ytransform = 'log10(y)' 
     82 
    7683        # Transform data if required. 
    77         # TODO: it properly! 
    78         #if data.xtransform is not None or data.ytransform is not None: 
    79         #    a, b, c, d = GuiUtils.xyTransform(self.data, self.data.xtransform, self.data.ytransform) 
     84        if self.data.xtransform is not None or self.data.ytransform is not None: 
     85            _, _, xscale, yscale = GuiUtils.xyTransform(self.data, self.data.xtransform, self.data.ytransform) 
     86            if xscale != 'log': 
     87                self.xscale = xscale 
     88            if yscale != 'log': 
     89                self.yscale = yscale 
     90 
     91            # Redefine the Scale properties dialog 
     92            self.properties = ScaleProperties(self, 
     93                                    init_scale_x=self.data.xtransform, 
     94                                    init_scale_y=self.data.ytransform) 
    8095 
    8196        # Shortcuts 
     
    276291        if self.properties.exec_() == QtWidgets.QDialog.Accepted: 
    277292            self.xLogLabel, self.yLogLabel = self.properties.getValues() 
     293            self.data.xtransform = self.xLogLabel 
     294            self.data.ytransform = self.yLogLabel 
    278295            self.xyTransform(self.xLogLabel, self.yLogLabel) 
    279296 
  • src/sas/qtgui/Utilities/GuiUtils.py

    r3b3b40b rbb57068  
    719719    if data.id == 'fit': 
    720720        return 
     721 
     722    # make sure we have some function to operate on 
     723    if xLabel is None: 
     724        xLabel = 'log10(x)' 
     725    if yLabel is None: 
     726        yLabel = 'log10(y)' 
    721727 
    722728    # control axis labels from the panel itself 
Note: See TracChangeset for help on using the changeset viewer.