trying to plot a stacked bar plot in ggplot. Having a hard time changing the position of the legend and the color scheme used by the default settings.
I have some data that's been melted into 5 columns called R1, R2, R3, variable, value
stackedCE <- ggplot() +
geom_bar(data= all_melted, stat = "identity", color = "black", aes(x= R2,
y= value, fill=variable, width =0.5)) +
ylab("ratio") +
scale_y_continuous(limits=c(0,100)) +
scale_color_manual(labels=c("Phase 1", "Phase 2"),
values = c("grey34", "grey88")) +
xlab("Time (Days)") +
theme(legend.title = element_blank(), legend.position ="top") +
theme_bw() +
facet_grid(R1 ~ R3, scales="free")
The plot generated works but the colors don't change for the default and the legend title and labels remain the same. Any quick hints would be much appreciated.