def colorBoxPlot(ax, bplot, colors):
    """
    color the boxplots with the desired color
    
    Borrowed from the amazing matplotlib gallery
    http://matplotlib.org/examples/pylab_examples/boxplot_demo2.html
    """
    import matplotlib.artist as art
    from matplotlib.patches import Polygon
    tocolor = []
    for i in range(1, len(bplot['whiskers']), 2):
        color = colors[i / 2]
        try:
            tocolor.append((bplot['caps'][i - 1], color))
            tocolor.append((bplot['caps'][i], color))
        except:
            pass
        try:
            tocolor.append((bplot['fliers'][i - 1], color))
            tocolor.append((bplot['fliers'][i], color))
        except:
            pass
        try:
            tocolor.append((bplot['whiskers'][i - 1], color))
            tocolor.append((bplot['whiskers'][i], color))
        except:
            pass
    for obj, color in tocolor:
        art.setp(obj, color=color, linewidth=2)
    for i in range(len(bplot['boxes'])):
        box = bplot['boxes'][i]
        median = bplot['medians'][i]
        color = colors[i]
        art.setp(box, color=color, linewidth=2)
        art.setp(median, color=color, linewidth=2)
        boxX = []
        boxY = []
        for j in box.get_xdata():
            boxX.append(j)
        for j in box.get_ydata():
            boxY.append(j)
        boxCoords = zip(boxX, boxY)
        boxPolygon = Polygon(boxCoords, facecolor=color, alpha=0.66)
        ax.add_patch(boxPolygon)
