Changeset 8462:d8ea193411ec in orange


Ignore:
Timestamp:
07/26/11 09:20:49 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
e9f56f0c404b667e6e55b0441a47efcc01b0b8cd
Message:

Properly recreate Scatterplot legend entries every time the graph is updated

Location:
orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWScatterPlotGraphQt.py

    r8437 r8462  
    5757    # update shown data. Set labels, coloring by className .... 
    5858    def updateData(self, xAttr, yAttr, colorAttr, shapeAttr = "", sizeShapeAttr = "", labelAttr = None, **args): 
    59 #        if not self.haveData: 
    6059        self.clear() 
    61 #            self.oldLegendKeys = {} 
    62 #            return 
    63         # self.removeDrawingCurves(removeLegendItems = 0)      # my function, that doesn't delete selection curves 
    64         # self.detachItems(QwtPlotItem.Rtti_PlotMarker) 
    65         # self.tips.removeAll() 
    6660        self.tooltipData = [] 
    6761        self.potentialsClassifier = None 
     
    309303        # ############################################################## 
    310304        # show legend if necessary 
     305        qDebug("Updating, legend is " + repr(self.showLegend)) 
    311306        if self.showLegend == 1: 
    312307            legendKeys = {} 
     
    355350            legendKeys = {} 
    356351 
    357         if legendKeys != self.oldLegendKeys: 
    358             self.oldLegendKeys = legendKeys 
    359             self.legend().clear() 
    360             for val in legendKeys.values():       # add new curve keys 
    361                 for i in range(len(val[1])): 
    362                     self.addCurve(val[0][i], val[1][i], val[1][i], val[2][i], symbol = val[3][i], enableLegend = 1) 
     352        for val in legendKeys.values():       # add new curve keys 
     353            for i in range(len(val[1])): 
     354                self.addCurve(val[0][i], val[1][i], val[1][i], val[2][i], symbol = val[3][i], enableLegend = 1) 
    363355 
    364356        # ############################################################## 
  • orange/OrangeWidgets/plot/owplot.py

    r8460 r8462  
    430430        self._transform_cache = {} 
    431431        self.clear_markers() 
     432        self.tips.removeAll() 
    432433        self.legend().clear() 
    433434         
Note: See TracChangeset for help on using the changeset viewer.