I generated this plot using ggplot2. A working example that will generate a similar graph is
set.seed(123)
prds=data.frame(Predicted=0.01*0:10,
outcome=abs(0.01*0:10-0.02+0.04*runif(11)))
ggplot(prds,aes(x = Predicted, y = as.numeric(outcome))) +
theme_bw() +
geom_abline(slope = 1, intercept = 0, color = "blue", lwd=1.3) +
geom_smooth(color = "red", se = FALSE, lwd=1.3) +
ylab("Observed") +
coord_cartesian(xlim = c(0,0.1), ylim = c(0,0.1), expand = F)
However, I couldn't find how
to add the legend, and due to a tight deadline I ended by adding it manually using an image editing tool? Is there a way to add it by using ggplot2?