Changeset f4a1433 in sasview for src/sas/sasgui/plottools


Ignore:
Timestamp:
Oct 24, 2017 2:44:26 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:
fca1f50, d6b234b
Parents:
16afe01 (diff), 5582b078 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ESS_GUI

Location:
src/sas/sasgui/plottools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/plottools/LineModel.py

    r959eb01 ra26f67f  
    22""" 
    33Provide Line function (y= Ax + B). Until July 10, 2016 this function provided 
    4 (y= A + Bx).  This however was contrary to all the other code using it which  
     4(y= A + Bx).  This however was contrary to all the other code using it which 
    55assumed (y= mx+b) or in this nomenclature (y=Ax + B). This lead to some 
    66contortions in the code and worse incorrect calculations until now for at least 
     
    6767        Evaluate the model 
    6868 
    69         :note: This is the function called by fitDialog to calculate the 
    70         the y(xmin) and y(xmax), but the only difference between this and 
    71         runXY is when the if statement is true. I however cannot see what that 
    72         function is for.  It needs to be documented here or removed. 
    73         PDB 7/10/16  
    74  
    7569        :param x: simple value 
    7670 
    7771        :return: (Line value) 
     72 
     73        .. note:: 
     74            This is the function called by fitDialog to calculate the 
     75            the y(xmin) and y(xmax), but the only difference between this and 
     76            runXY is when the if statement is true. I however cannot see what 
     77            that function is for.  It needs to be documented here or removed. 
     78            PDB 7/10/16 
    7879        """ 
    7980        if x.__class__.__name__ == 'list': 
     
    8990        """ 
    9091        Evaluate the model. 
    91          
    92         :note: This is to be what is called by fitDialog for the actual fit 
    93         but the only difference between this and run is when the if  
    94         statement is true. I however cannot see what that function 
    95         is for.  It needs to be documented here or removed. PDB 7/10/16  
    9692 
    9793        :param x: simple value 
     
    9995        :return: Line value 
    10096 
     97        .. note:: 
     98            This is to be what is called by fitDialog for the actual fit 
     99            the only difference between this and run is when the if 
     100            statement is true. I however cannot see what that function 
     101            is for.  It needs to be documented here or removed. PDB 7/10/16 
    101102        """ 
    102103        if x.__class__.__name__ == 'list': 
  • src/sas/sasgui/plottools/__init__.py

    rd7bb526 refe730d  
    1 import config 
    21from PlotPanel import PlotPanel 
    32from plottables import Data1D, Theory1D 
  • src/sas/sasgui/plottools/plottables.py

    r45dffa69 r2d9526d  
    239239    def replace(self, plottable): 
    240240        """Replace an existing plottable from the graph""" 
    241         selected_color = None 
     241        # If the user has set a custom color, ensure the new plot is the same color 
     242        selected_color = plottable.custom_color 
    242243        selected_plottable = None 
    243244        for p in self.plottables.keys(): 
    244245            if plottable.id == p.id: 
    245246                selected_plottable = p 
    246                 selected_color = self.plottables[p] 
     247                if selected_color is None: 
     248                    selected_color = self.plottables[p] 
    247249                break 
    248         if  selected_plottable is not None and selected_color is not None: 
     250        if selected_plottable is not None and selected_color is not None: 
    249251            del self.plottables[selected_plottable] 
     252            plottable.custom_color = selected_color 
    250253            self.plottables[plottable] = selected_color 
    251254 
  • src/sas/sasgui/plottools/config.py

    ra2a1c20 r092a3d9  
    3030__all__ = [] 
    3131 
    32 plot_version = "0.98" 
    33 plot_backend = "WXAgg" 
     32#plot_version = "0.98" 
     33#plot_backend = "WXAgg" 
     34plot_backend = "Qt4Agg" 
    3435 
    3536# Sort out matplotlib version 
    3637import matplotlib 
    37 try: 
    38     import pkg_resources 
    39     pkg_resources.require("matplotlib>=" + plot_version) 
    40 except ImportError: 
    41     from distutils.version import LooseVersion as Version 
    42     if Version(matplotlib.__version__) < Version(plot_version): 
    43         msg = "Matplotlib version must be %s or newer" % (plot_version, ) 
    44         raise ImportError(msg) 
     38#try: 
     39#    import pkg_resources 
     40#    pkg_resources.require("matplotlib>=" + plot_version) 
     41#except: 
     42#    from distutils.version import LooseVersion as Version 
     43#    if Version(matplotlib.__version__) < Version(plot_version): 
     44#        msg = "Matplotlib version must be %s or newer" % (plot_version, ) 
     45#        raise ImportError(msg) 
    4546 
    4647# Sort out matplotlib backend 
     
    5152elif matplotlib.get_backend() != plot_backend: 
    5253    # if a backend has already been selected, make sure it is the correct one. 
    53     raise ImportError("Matplotlib not using backend " + plot_backend) 
     54    #raise ImportError("Matplotlib not using backend " + plot_backend) 
     55    pass 
    5456 
    5557# set global plot style 
     
    5860matplotlib.rcParams[param] = 0.05 
    5961matplotlib.rcParams['legend.numpoints'] = 1 
     62#matplotlib.rcParams['interactive'] = True 
     63 
    6064 
    6165# this should happen after initial matplotlib configuration 
    62 from .toolbar import NavigationToolBar 
    63 from matplotlib.backends import backend_wxagg 
    64 backend_wxagg.NavigationToolbar2WxAgg = NavigationToolBar 
     66#from .toolbar import NavigationToolBar 
     67#from matplotlib.backends import backend_wxagg 
     68#backend_wxagg.NavigationToolbar2WxAgg = NavigationToolBar 
    6569 
    6670# CRUFT: bumps 0.7.5.6 and older uses wrong toolbar 
    67 backend_wxagg.NavigationToolbar2Wx = NavigationToolBar 
     71#backend_wxagg.NavigationToolbar2Wx = NavigationToolBar 
  • src/sas/sasgui/plottools/toolbar.py

    r959eb01 rc416a17  
    171171    wx.TheClipboard.SetData(bmp) 
    172172    wx.TheClipboard.Close() 
    173  
    174  
Note: See TracChangeset for help on using the changeset viewer.