In a ggplot (geom_bar), I'm looking to plot the zero-values in a different color.
Code for the bar-graph itself:
ggplot(Rodeococha, aes(x=Age ,y=Quantity)) +
geom_bar(color="dark red", stat = "identity")
And using the instructions for colouring specific values found on a different page I tried cutting my values into intervals and constructed:
ggplot(data= Rodeococha, aes(x= Age ,y= Quantity)) +
geom_bar(aes(colour = cut(qsec, c(-Inf,0,Inf))), stat = "identity") +
scale_colour_manual(name = "qsec", values = c("(-Inf,0]" = "black",
"(0,Inf]" = "red"))
Atm it gives the error
Error in cut(qsec, c(-Inf, 0, Inf)) : object 'qsec' not found.
Before this error, it also gave a few other errors so instead of taking even more time tackling this one error I thought why not ask advice, maybe there is someone else with a better idea.
Edit: the answer from @Tjebo worked.
For clarification to others: the plot is actually a stacked plot with 7 x-axes each containing multiple bars. This code was just the first x-axis. Showing the zeros in a different color was to make interpretation more easy.