I have been trying to add a legend and amend it, however after spending hours on different websites, books, etc. I was unable to do it.
Data used to produce below graphs ->
Edit: To place the scatter plots as 2 graphs in 1 chart you can use facet_wrap()
like below.
...
facet_wrap(~set)
stat_regline_equation(aes(color = set),
show.legend = FALSE,
label.y = c(0.25, 0.25))
stat_cor(aes(color = set),
label.y = c(0.23, 0.23),
show.legend = FALSE)
...
If you want both to have their own y axis, add scales = "free_y"
to facet_wrap()
.