I made a barplot in ggplot, but, purely for aesthetic reasons, I want to change the order of the Legend categories. Here's my script:
library(ggplot2)
df <- data.frame(Month = c(4, 5, 6, 7, 8, 9, 10, 11),
variable = rep(c("Outlier", "NOutlier"), 4),
value = c(8, 9, 10, 5, 12, 13, 9, 10))
hist_overall <- ggplot(df, aes(x = Month, y = value, fill = variable)) +
geom_bar(stat = "identity") +
scale_fill_manual("Legenda", values = c("Outlier" = "#1260AB", "NOutlier" = "#009BFF"))
hist_overall
I don't want to do anything with the data, I just want to change the Legend order, so that the darkblue category 'Outlier' is depicted on top of the lightblue category 'NOutlier'.
Anyone knows of a quick way for me to do this?