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
A ggplot2 solution using geom_bar with stat_identity.
library(ggplot2)
ggplot(dat, aes(x= seq_along(x), y = x)) +
geom_bar(stat = 'identity', aes(fill = x>0), position = 'dodge', col = 'transparent') +
theme_bw() + scale_fill_discrete(guide = 'none') +
labs(x = '', y = 'NAO Index')

scale_fill_discrete(guide = 'none') removes the legend, position = 'dodge' stops the warning that comes from the default position = 'stack'.