def __call__(self, data, index):
        x = data[self.column].iget(index)
        a = min(data[self.column])
        b = max(data[self.column])
        r1, g1, b1 = self.colour1
        r2, g2, b2 = self.colour2
        r3, g3, b3 = self.colour3
        x_scaled = (x - a) / (b - a)
        if x_scaled < 0.5:
            x_scaled *= 2.0
            return (r1 + (r2 - r1) * x_scaled,
                    g1 + (g2 - g1) * x_scaled,
                    b1 + (b2 - b1) * x_scaled)
        else:
            x_scaled = (x_scaled - 0.5) * 2.0
            return (r2 + (r3 - r2) * x_scaled,
                    g2 + (g3 - g2) * x_scaled,
                    b2 + (b3 - b2) * x_scaled)
Return a colour corresponding to data attribute value.
dataset/ETHPy150Open pydata/pandas/pandas/tools/rplot.py/ScaleGradient2.__call__