I have created a mirrored bar chart to compare two variables. I have managed to get each of these a different colour, but haven't had any success with getting a figure legend to explain what each part means. For example, what the top graph means and what the bottom means. Additionally, for another graph I would like to have a legend at the side to give added information about the x axis categories since they do not fit.
This should be pretty simple, but I've tried fill= with no luck. My problem is I am not sure where to put the command in the code since I have effectively combined two separate graphs.
new2 <- mutate(new, Review = -Review)
p2<-ggplot(new2, aes(x = metric)) + geom_col(aes(y = Mine), fill = "lightblue", width=0.3, position=position_dodge(width=0.1)) + geom_col(aes(y = Review), fill = "lightgreen", width=0.3, position=position_dodge(width=0.1)) + xlab("Metric") + ylab("Percentage")
My data looks like this: Data
I would appreciate any thoughts on how I can add a figure legend at the side. I have no problem doing this in standard barcharts.