[Solved] How to add a legend to ggplot when aes are constant for stat_smooth
You can still use aes in each stat_smooth including only the desired color. This will add legends to the plot. Then you can use scale_color_identity to match and rename the colors ggplot(mtcars, aes(x=wt, y = mpg, col=”green”)) + geom_point(col=”blue”) + stat_smooth(method=’loess’,linetype=”dashed”, aes(color = “red”), span=0.1) + stat_smooth(method=’loess’,linetype=”dashed”, aes(color = “orange”), span=0.25) + stat_smooth(method=’loess’,linetype=”dashed”, aes(color = … Read more