I am trying to plot a simple bar plot; however, every time I try, I get a gray style plot. I read the answer here Change bar plot colour in geom_bar with ggplot2 in r and followed the steps explained there, but I still get "gray color". I am not sure, maybe I am missing detail in my code. Here is my code:
out<- table(sub_select$yq, sub_select$AEoutcome)
out<-cbind(out, Precentage = out[,2]/rowSums(out))
out <- as.data.frame(out)
the result is in this form:
FALSE TRUE Precentage
2014 Q4 880 46 0.04967603
2015 Q1 1815 77 0.04069767
2015 Q2 1677 73 0.04171429
2015 Q3 1191 50 0.04029009
2015 Q4 555 13 0.02288732
then I run the following code:
x <- rownames(out)
ggplot(data=out, aes(x=x, y=Precentage), fill = x) +
geom_bar(stat="identity", position=position_dodge()) +
geom_text(aes(label=round(Precentage, digit=3)), vjust=1.6, color="black", position = position_dodge(0.9),size=3.5)
and this will return a graph in gray color. Any suggestions on how to fix this? Thanks