Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.