I'm needing to plot two regressions on the same axes. For this I have 3 columns in my dataset (let's call them A, B & C). I want to plot B against A and then C against A, and have these as different colour regression lines, with the data points being the same colour as their corresponding lines.
To be more specific, to create individual plots I used the following code for the first one:
P1 <- ggplot(data=volboth, aes(x=control, y=vol30)) +
geom_point(alpha=1, size=4, color="maroon") +
ggtitle("Correlation Plot: Ground Survey (Control) vs 30m UAV Survey") +
labs(x = expression(paste("Volume - Control Data - ", m^{3})),
y = expression(paste("Volume - Aerial Data - ", m^{3}))) +
xlim(0, 5) +
ylim(0, 5) +
geom_smooth(method=lm, se=FALSE, fullrange=TRUE)
And then the following for the second plot:
P2 <- ggplot(data=volboth, aes(x=vol10, y=control)) +
geom_point(alpha=1, size=4, color="maroon") +
ggtitle("Correlation Plot: Ground Survey (Control) vs 10m UAV Survey") +
labs(x = expression(paste("Volume - Aerial Data - ", m^{3})),
y = expression(paste("Volume - Control Data - ", m^{3}))) +
xlim(0, 5) +
ylim(0, 5) +
geom_smooth(method=lm, se=FALSE, fullrange=TRUE)
Any ideas of how to combine both plots onto same axes, and to apply corresponding visual themes? I'm open to using standard R (not ggplot2) if that makes things easier.