As shown below, I am trying to find a cool way to show some variance weighted deviation from the mean. There are 10 attributes that I compute the distance for.
How can I add a color function such that it is progressively a darker shade of red when its value is negative (towards the left) and green when the value is positive (towards the right of the graphics)?
distance = {0.245, -0.235, 0.053, -0.048, -0.128,
-0.007, -0.075, -0.067,-0.005, 0.082}
Show[
Function[
attributes,
Graphics[
Rectangle[
{If[distance[[attributes]] < 0, distance[[attributes]]*10, 0],
attributes - 1},
{If[distance[[attributes]] < 0, 0, distance[[attributes]]*10],
attributes}
],
PlotRange -> {{-5, 5}, {0, 10}},
Epilog -> {White, Line[{{0, 0}, {0, 11}}]}
]] /@ Range[10],
Frame -> True]
Blend[{Darker[Red], Lighter[Green]}, #] &
? $\endgroup$