I am creating a very simple plot that groups data and uses the grouping variable to determine linestyle and colour. I then override those using \'scale_linetype_manaul\' and
This might help:
ggplot(X, aes(x=horizon, y=value, group=TPP, col=TPP, linetype=TPP))+geom_line(size=1)+
scale_linetype_manual(name="X", values = c("solid","dashed", "dotted"),labels=c("Low", "5","High")) +
scale_color_manual(name ="X", values = c("black", "red", "blue"),labels=c("Low", "5","High"))
If the labels defined in scale_color_manual
and in scale_linetype_manual
are different, or if they are specified in only one of them, you will obtain two different legends.