I am trying to create a plot which includes multiple geom_smooth trendlines within one plot. My current code is as follows:
png(filename="D:/Users/...", width = 10, height = 8, units = 'in', res = 300)
ggplot(Data) +
geom_smooth(aes(BA,BAgp1),colour="red",fill="red") +
geom_smooth(aes(BA,BAgp2),colour="turquoise",fill="turquoise") +
geom_smooth(aes(BA,BAgp3),colour="orange",fill="orange") +
xlab(bquote('Tree Basal Area ('~cm^2~')')) +
ylab(bquote('Predicted Basal Area Growth ('~cm^2~')')) +
labs(title = expression(paste("Other Softwoods")), subtitle = "Tree Level Basal Area Growth") +
theme_bw()
dev.off()
Which yields the following plot:
The issue is I can't for the life of me include a simple legend where I can label what each trendline represents. The dataset is quite large- if it would be valuable in indentifying a solution I will post externally to Stackoverflow.