I keep trying to get a legend to show up on my plot for the color but nothing is showing up. Any advice would be great:
# example data:
> dput(head(total_org))
structure(list(Sample = c("T0", "Aer 4hr", "Aer 8hr", "Aer 24hr",
"Aer 28day", "Ana 4hr"), Percent = c(0.3, 3.15, 4, 2.37, 16.27,
0.98), stdev = c(0, 0.75, 0.63, 1.63, 3.54, 0.6)), row.names = c(1L,
3L, 4L, 5L, 6L, 7L), class = "data.frame")
# ggplot code
ggplot(total_org,aes(x=factor(Sample,level=c("T0","Aer 4hr","Ana 4hr",
"CA 4hr","Aer 8hr","Ana 8hr",
"CA 8hr","Aer 24hr","Ana 24hr",
"CA 24hr","Aer 28day","Ana 28day",
"CA 28day")),
y=Percent))+
geom_col(position=position_dodge(),fill="#FD8F6F")+
labs(y="% of Dry Matter by Mass")+
scale_x_discrete(labels=c("T0","A\n4h","An\n4h","CA\n4hr",
"A\n8hr","An\n8hr","CA\n8hr","A\n24hr",
"An\n24hr","CA\n24hr","A\n28day","An\n28day","CA\n28day"))+
geom_errorbar(aes(ymin=Percent-stdev,
ymax=Percent+stdev),
position=position_dodge())+
theme_classic()+
theme(axis.title.x=element_blank(),legend.title=element_blank(),
legend.text =element_text(size=15),axis.title.y=element_text(size=15),
legend.position="bottom",axis.text.x=element_text(size=15),
axis.text.y=element_text(size=12),
panel.grid.major.y=element_line(color=1,size=0.5,linetype=2),
panel.grid.minor.y=element_line(color="black",size=0.25,linetype=3))
I had it working for a bit, but I changed the order of the data being presented and now it isn't working anymore. Any advice would be great, thanks.