title: How ggplot2 shows two different regression lines with same y but different x
body: <p>say I have the following code using basic plot function.</p>
  
  <blockquote>
    <p>plot(mydata$x1,mydata$y,xlab="x1",ylab="y",type="n")</p>
    
    <p>abline(lm(y~x1,data=mydata))`</p>
    
    <p>abline(lm(y~x2,data=mydata),lty=2)'</p>
  </blockquote>
  
  <p>This will show two regression lines in a single graph, one is y=p*x1, one is y=p*x2   (p are parameters)</p>
  
  <p>since I am using different x for the same y, how can I show the two regression lines together using ggplot2?
  I tried to define two geom_smooth. But the results are not correct.</p>
  
  <blockquote>
    <p>geom_smooth(aes(y=y,x=x1))+gemo_smooth(aes(y=y,x=x2))</p>
  </blockquote>