diff SMART/Java/Python/plot.py @ 46:169d364ddd91

Uploaded
author m-zytnicki
date Mon, 30 Sep 2013 03:19:26 -0400
parents 2c0c0a89fad7
children
line wrap: on
line diff
--- a/SMART/Java/Python/plot.py	Wed Sep 18 08:51:22 2013 -0400
+++ b/SMART/Java/Python/plot.py	Mon Sep 30 03:19:26 2013 -0400
@@ -134,11 +134,7 @@
         values   = dict([i * step + minValue, 0] for i in range(0, self.nbBars))
         top      = (self.nbBars - 1) * step + minValue
         for key, value in line.iteritems():
-            divisor = float(maxValue - minValue) * self.nbBars
-            tmpMinValue = top
-            if divisor != 0:
-                tmpMinValue = min(top, int(math.floor((key - minValue) / divisor)))
-            newKey =  tmpMinValue * step + minValue
+            newKey = min(top, int(math.floor((key - minValue) / float(maxValue - minValue) * self.nbBars)) * step + minValue)
             values[newKey] += value
         return values