I am trying to create a barplot that illustrates the number of issue reports for certain issues in an 'imaginary' business. I have used abline() to add a line at a certain value and would like to change the color of the bar above this point. Is such a thing possible to do? Thanks in advance.
My code is as follows:
H<-c(30,35,7,12)
M<-c("Issue 1","Issue 2","Issue 3","Issue 4")
par(mar=c(5,5,5,5))
barplot(H,names.arg=M,ylab="No. of issues",col="light grey",
main="Issue Analysis",border="black",las=2)
abline(h=20,col="red",lty=2)
And the produced graph is:
So, you should see that above the red line is the portion of the first two bars that I want to highlight.
Thanks