I have a plot in which I am displaying individual values from multiple subjects, coloured by group. Added to that are means per group, calculated using stat_summary.
You need to create different values for the mapping to color:
ggplot(data=iris,
aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
geom_line() + geom_point() + theme_bw() +
stat_summary(fun.y=mean, geom="line", size=1.5,
linetype="dotted", aes(color=paste("mean", Species)))
You can then use scale_color_manual
to get specific colors.