Ignore:
Timestamp:
04/02/12 18:12:04 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed scatterplot (and linear projection) point jittering (now remains the same through subset data changes), fixes #1170.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Visualize/OWLinProjGraph.py

    r10476 r10705  
    221221            shownSubsetCount = 0 
    222222            subsetIdsToDraw = dict([(example.id,1) for example in self.rawSubsetData]) 
    223  
     223            subsetIdsAlreadyDrawn = set() 
    224224            # draw the rawData data set. examples that exist also in the subset data draw full, other empty 
    225225            for i in range(dataSize): 
    226                 if not validData[i]: continue 
     226                if not validData[i]: 
     227                    continue 
    227228                if subsetIdsToDraw.has_key(self.rawData[i].id): 
    228                     continue 
     229                    instance_filled = 1 
     230                    subsetIdsAlreadyDrawn.add(self.rawData[i].id) 
     231                else: 
     232                    instance_filled = 0 
    229233 
    230234                if self.dataHasDiscreteClass and self.useDifferentColors: 
     
    240244                    curveSymbol = self.curveSymbols[0] 
    241245 
    242                 if not xPointsToAdd.has_key((newColor, curveSymbol,0)): 
    243                     xPointsToAdd[(newColor, curveSymbol,0)] = [] 
    244                     yPointsToAdd[(newColor, curveSymbol,0)] = [] 
    245                 xPointsToAdd[(newColor, curveSymbol,0)].append(x_positions[i]) 
    246                 yPointsToAdd[(newColor, curveSymbol,0)].append(y_positions[i]) 
     246                if not xPointsToAdd.has_key((newColor, curveSymbol, instance_filled)): 
     247                    xPointsToAdd[(newColor, curveSymbol, instance_filled)] = [] 
     248                    yPointsToAdd[(newColor, curveSymbol, instance_filled)] = [] 
     249                xPointsToAdd[(newColor, curveSymbol, instance_filled)].append(x_positions[i]) 
     250                yPointsToAdd[(newColor, curveSymbol, instance_filled)].append(y_positions[i]) 
    247251                if self.showValueLines: 
    248252                    self.addValueLineCurve(x_positions[i], y_positions[i], newColor, i, indices) 
     
    260264 
    261265            for i in range(len(self.rawSubsetData)): 
    262                 if not validSubData[i]: continue    # check if has missing values 
     266                if not validSubData[i]: # check if has missing values 
     267                    continue 
     268                if self.rawSubsetData[i].id in subsetIdsAlreadyDrawn: 
     269                    continue 
    263270 
    264271                if not self.dataHasClass or self.rawSubsetData[i].getclass().isSpecial(): 
Note: See TracChangeset for help on using the changeset viewer.