I have a basic bar graph I\'ve created from ggplot2. The y variable contains both positive and negative values and about half the vector of values are negative. I would like
You can provide a vector of colors to the axis.text.x option of theme():
axis.text.x
theme()
a <- ifelse(data$category == 0, "red", "blue") ggplot(data, aes(x = x, y = y)) + geom_bar(stat = "identity", aes(fill = category)) + theme(axis.text.x = element_text(angle = 45, hjust = 1, colour = a))