I'm trying to plot 4 regressions, all having the same predictor, with according points in 4 different colors. I'd need a legend that assigns 4 labels to the 4 colors. Merely just a simple table with 2 columns. However when trying to set a manual with scale_linetype_manualor scale_fill_manual, no legend appears.
Forest_EPs_pure <- data.frame("Sand"=c(23,41,32,34,38,49,32,18,91,18,117,61,68,43,46,59,74,88,58,92,882,941,870,926,861,848,810,964,874,860,755,942),
"B2_fs"=c(61,68,80,20,43,72,93,60,75,75,97,83,74,51,87.5,74,97,74,71,60,0,0,0,0,0,0,17,0,0,0,0,0),
"H_total"=c(89.7,109.6,15.4,140.1,145.4,164,11.6,118.1,110.8,50.4,77.8,124.6,115.6,152,63.6,112.9,127.7,138.5,69.8,149.4,32,63.4,35.7,84.5,5.8,0,8.8,1.6,20.2,31.8,25.8,0.5),
"B1_fs"=c(0,0,0.5,0,0.5,0,3,0,0,0.5,2,10,0,0,7,0,0,20,15,18,75,71,115,72,65,95,40,35,43,96,98,95),
"S_total"=c(8.6,8.5,2.2,18.9,37.9,53.1,3.8,76,67.4,4.8,35.2,78,74.5,65.6,41.6,58,37.1,60.7,68,39.5,44.4,69.6,5.5,42.1,19.3,0,77.1,0.5,96.2,2.0,8.5,0.5))
ggplot(data=Forest_EPs_pure, aes(x=Sand))+
geom_point(aes(y=B2_fs), color="green")+
geom_point(aes(y=H_total), color="black")+
geom_point(aes(y=B1_fs), color="brown")+
geom_point(aes(y=S_total), color="grey")+
geom_smooth(aes(y=B2_fs), method="glm",color="green")+
geom_smooth(aes(y=H_total), method="glm", color="black")+
geom_smooth(aes(y=B1_fs), method="glm", color="brown")+
geom_smooth(aes(y=S_total), method="glm", color="grey")+
scale_x_continuous("Sand content in g/kg")+
scale_y_continuous("Share of respective layer in %")