So in ggplot2
, I can't figure out how to control both the legend name of a line and the color of that line.
For example:
ggplot(data.frame(x=1:5,y=1:5), aes(x,y,colour='name')) + geom_line()
creates a red line with legend name "name", while if I instead use the argument geom_line(colour='blue')
, I get a blue line with no legend name:
How do I control both the color of the line AND the title of my line in the legend??