Changeset 55:cda1d0456628 in orange
- Timestamp:
- 04/08/03 11:39:00 (10 years ago)
- Branch:
- default
- Convert:
- adeb50af347d314ba3b155ae7db4fdaf85f84f6a
- File:
-
- 1 edited
-
orange/OrangeWidgets/OWParallelGraph.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
orange/OrangeWidgets/OWParallelGraph.py
r54 r55 169 169 if data[i][index].isSpecial(): temp.append(1) 170 170 else: 171 val = (1.0 + 2.0*float(variableValueIndices[data[i][index].value])) / float(2*count) + 0. 3* self.rndCorrection(1.0/count)171 val = (1.0 + 2.0*float(variableValueIndices[data[i][index].value])) / float(2*count) + 0.2 * self.rndCorrection(1.0/count) 172 172 temp.append(val) 173 173 … … 221 221 self.setAxisMaxMinor(QwtPlot.xBottom, 0) 222 222 self.setAxisMaxMajor(QwtPlot.xBottom, len(labels)) 223 self.setAxisMaxMinor(QwtPlot.yLeft, 0) 224 self.setAxisMaxMajor(QwtPlot.yLeft, 1) 225 223 226 224 227 if len(self.scaledData) == 0 or len(labels) == 0: self.updateLayout(); return … … 268 271 269 272 def showDistributionValues(self, className, data, indices): 270 # create color table 273 # get index of class 274 classNameIndex = 0 275 for i in range(len(data.domain)): 276 if data.domain[i].name == className: classNameIndex = i 277 278 # create color table 271 279 count = float(len(data.domain[className].values)) 272 280 if count < 1: … … 302 310 # processing for distributions 303 311 attrIndex = variableValueIndices[data[i][index].value] 304 classIndex = classValueIndices[data[i] .getclass().value]312 classIndex = classValueIndices[data[i][classNameIndex].value] 305 313 totals[attrIndex] += 1 306 314 values[classIndex][attrIndex] = values[classIndex][attrIndex] + 1 307 315 308 316 maximum = 0 317 for i in range(len(values)): 318 for j in range(len(values[i])): 319 if values[i][j] > maximum: maximum = values[i][j] 320 309 321 # create bar curve 310 322 for i in range(count): … … 316 328 yData = [] 317 329 for j in range(attrLen): 318 width = float(values[i][j]*0.5) / float(totals[j]) 330 #width = float(values[i][j]*0.5) / float(totals[j]) 331 width = float(values[i][j]*0.5) / float(maximum) 319 332 interval = 1.0/float(2*attrLen) 320 #yOff = (j / float(attrLen-1)) * (1.0-2.0*interval)321 333 yOff = float(1.0 + 2.0*j)/float(2*attrLen) 322 334 height = 0.7/float(count*attrLen)
Note: See TracChangeset
for help on using the changeset viewer.
