I\'ve been creating some bar-charts and I was wondering is it possible to colour bars on a chart depending on whether they lie above or below the x-axis?
For clarifi
I found this page while looking for help on how to colour individual bars in a bar chart according to a factor. I couldn't find any other source of information but thanks to this page, came up with this:
cols <- ifelse(df$Country == "Greenland", "green","blue")
It then gets passed into barplot in the usual way as described above:
barplot(x, col = cols)