Changeset 8717:4dd34f5cfe7c in orange


Ignore:
Timestamp:
08/16/11 09:03:15 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
453c8e357391a1ed2717558702557ff995512c53
Message:

Detach probability curves when they checkbox is unchecked.

Location:
orange/OrangeWidgets/Visualize Qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize Qt/OWLinProjGraphQt.py

    r8696 r8717  
    7474         
    7575        self.value_line_curves = [] 
     76        self.potentialsCurve = None 
    7677 
    7778    def setData(self, data, subsetData = None, **args): 
     
    176177        yPointsToAdd = {} 
    177178 
     179        if self.potentialsCurve: 
     180            self.potentialsCurve.detach() 
     181            self.potentialsCurve = None 
    178182        if self.showProbabilities and self.haveData and self.dataHasClass: 
    179183            # construct potentialsClassifier from unscaled positions 
     
    186190            if classData.any(): 
    187191                self.potentialsClassifier = orange.P2NN(domain, numpy.transpose(numpy.array([numpy.compress(validData, self.unscaled_x_positions), numpy.compress(validData, self.unscaled_y_positions), classData])), self.anchorData, offsets, normalizers, averages, self.normalizeExamples, law=1) 
    188                 c = ProbabilitiesItem(self.potentialsClassifier, self.squareGranularity, self.trueScaleFactor/2, self.spaceBetweenCells, QRectF(-1, -1, 2, 2)) 
    189                 c.attach(self) 
     192                self.potentialsCurve = ProbabilitiesItem(self.potentialsClassifier, self.squareGranularity, self.trueScaleFactor/2, self.spaceBetweenCells, QRectF(-1, -1, 2, 2)) 
     193                self.potentialsCurve.attach(self) 
    190194            else: 
    191195                self.potentialsClassifier = None 
  • orange/OrangeWidgets/Visualize Qt/OWScatterPlotGraphQt.py

    r8716 r8717  
    4848 
    4949        self.enableWheelZoom = 1 
     50        self.potentialsCurve = None 
    5051 
    5152    def setData(self, data, subsetData = None, **args): 
     
    139140        # ####################################################### 
    140141        # show probabilities 
     142        if self.potentialsCurve: 
     143            self.potentialsCurve.detach() 
     144            self.potentialsCurve = None 
    141145        if self.showProbabilities and colorIndex >= 0 and self.dataDomain[colorIndex].varType in [orange.VarTypes.Discrete, orange.VarTypes.Continuous]: 
    142146            if self.dataDomain[colorIndex].varType == orange.VarTypes.Discrete: domain = orange.Domain([self.dataDomain[xAttrIndex], self.dataDomain[yAttrIndex], orange.EnumVariable(self.attributeNames[colorIndex], values = getVariableValuesSorted(self.dataDomain[colorIndex]))]) 
     
    156160            if probData.any(): 
    157161                self.potentialsClassifier = orange.P2NN(domain, probData, None, None, None, None) 
    158                 ProbabilitiesItem(self.potentialsClassifier, self.squareGranularity, 1., self.spaceBetweenCells).attach(self)             
     162                self.potentialsCurve = ProbabilitiesItem(self.potentialsClassifier, self.squareGranularity, 1., self.spaceBetweenCells) 
     163                self.potentialsCurve.attach(self) 
    159164            else: 
    160165                self.potentialsClassifier = None 
Note: See TracChangeset for help on using the changeset viewer.