I have a ggplot and I want to add a legend to it, but it reflects only color and not the shape. I used scale_shape_manual, but it still does not work. Here is what I have
plot <- ggplot(data.frame(labels, yes.percent.avgs.gc, yes.percent.avgs.dp, yes.percent.avgs.gm)) +
geom_point(aes(x=labels, y=yes.percent.avgs.gc, colour="GC"), shape=16, size=5) + # Plot individual points
geom_point(aes(x=labels, y=yes.percent.avgs.dp, colour="DP"), shape=17, size=5) + # Plot individual points
geom_point(aes(x=labels, y=yes.percent.avgs.gm, colour="GM"), shape=18, size=5) + # Plot individual points
geom_smooth(data=data.frame(labels, pred.avgs), aes(x=labels, y=pred.avgs, colour="Prediction Scores"), fill=NA, method=lm, size=1) +
xlab("Bin range") +
ylab("Argument Score") +
theme(legend.position = c(0.8, 0.2))+
scale_shape_manual(name = "Legend",
labels = c("GC", "DP", "GM"),
values = c(16, 17, 18))
plot # show the plot
How can I get the legend to show both color and shape.