I would like to rename the values in a legend without altering the custom colors that have already been set. Is there a way to set legend labels without using scale_color_manual
It is possible to specify the label names in scale_colour_manual
.
ggplot(dat, aes(XValue, color = Distribution)) +
stat_density(geom = "path", position = "identity", size = 2) +
scale_color_manual(values = c("yellow", "black", "forestgreen"),
labels = c("Distribution 1",
"Distribution 2",
"Distribution 3"))