diff --git a/datasets/raise/generate_histogram.py b/datasets/raise/generate_histogram.py index 6704e6f..5d589c3 100644 --- a/datasets/raise/generate_histogram.py +++ b/datasets/raise/generate_histogram.py @@ -9,15 +9,6 @@ image.histogram() HEX_COLOR = '#%02x%02x%02x' -def getRed(redIntensity): - return HEX_COLOR % (redIntensity, 0, 0) - -def getGreen(greenIntensity): - return HEX_COLOR % (0, greenIntensity, 0) - -def getBlue(blueIntensity): - return HEX_COLOR % (0, 0, blueIntensity) - def getColor(intensity, colorIndex): return HEX_COLOR % tuple((intensity if colorIndex == colorIndexTmp else 0) for colorIndexTmp in range(3)) @@ -28,17 +19,9 @@ red = histogram[0:COLOR_BASE] green = histogram[COLOR_BASE:COLOR_BASE*2] blue = histogram[COLOR_BASE*2:COLOR_BASE*3] -#for colorIndex, color in [red, green, blue] -plt.figure(0) -for i in range(0, COLOR_BASE): - plt.bar(i, red[i], color = getColor(i, 0),alpha=0.3) - -plt.figure(1) -for i in range(0, COLOR_BASE): - plt.bar(i, green[i], color = getColor(i, 1),alpha=0.3) - -plt.figure(2) -for i in range(0, COLOR_BASE): - plt.bar(i, blue[i], color = getColor(i, 2),alpha=0.3) +for colorIndex, color in enumerate([red, green, blue]): + #plt.figure(colorIndex) + for i in range(COLOR_BASE): + plt.bar(i, color[i], color = getColor(i, colorIndex), alpha = 0.3) plt.show() \ No newline at end of file