I have a list of values like these for example (varaible 1):
1 2 3 2 4 3
Which are plotted on a bar chart that has green bars. This is the only chart I'm working with.
I also have a list of corresponding values (variable 2) that goes like this:
1 -1 -1 0 1 -1
What I'd like to do is if variable 2 is negative, turn the color of the bar red, if it is positive, leave it green, and if it is 0, make it yellow. So in example above, the lengths of the bars in the chart would correspond to variable 1: 1, 2, 3, 2, 4, 3, and stay in the positive territory of the chart and the colors of the bars would be:
green red red yellow green red
How can I do this?
Thank you for your help.
Bookmarks