title: slope and intercept issue in scatterplot ggplot2
body: <p>I was drawing a regression line (linear) using <code>mtcars</code> dataset (<code>mpg ~ cyl</code>). I ran a simple linear model using <code>mpg</code> and <code>cyl</code> and executed a summary.</p>
  
  <p>Intercept from the linear model summary does not match with the graphical representation.</p>
  
  <p>I am having hard time understanding what is going on. If I use R's base plotting function to draw the scatterplot, I get the same result as ggplot2. I changed the y-axis scale limit (0, 40) without any success.</p>
  
  <p>Here is my code</p>
  
  <pre><code>data(mtcars)
  library(ggplot2)
  p &lt;- ggplot(mtcars, aes(x=cyl, y=mpg)) + geom_point(shape=1) # create graph
  p + geom_smooth(method = lm, se=FALSE) # add line
  lm.car &lt;- lm(mpg ~ cyl) # create linear model
  summary(lm.car) # summary
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/BaOro.png" alt="http://imageshack.us/photo/my-images/213/scatterplot.png/"></p>
  
  <p>Here is linear model output</p>
  
  <pre><code>&gt; summary(lm.car)
  
  Call:
  lm(formula = mpg ~ cyl)
  
  Residuals:
      Min      1Q  Median      3Q     Max 
  -4.9814 -2.1185  0.2217  1.0717  7.5186 
  
  Coefficients:
              Estimate Std. Error t value Pr(&gt;|t|)    
  (Intercept)  37.8846     2.0738   18.27  &lt; 2e-16
  
  cyl          -2.8758     0.3224   -8.92 6.11e-10 
  
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 
  
  Residual standard error: 3.206 on 30 degrees of freedom
  Multiple R-squared: 0.7262, Adjusted R-squared: 0.7171 
  F-statistic: 79.56 on 1 and 30 DF,  p-value: 6.113e-10 
  </code></pre>
  
  <p>Based on following suggestions I used </p>
  
  <pre><code>data(mtcars)
  library(ggplot2)
  p &lt;- ggplot(mtcars, aes(x=cyl, y=mpg)) + geom_point(shape=1) +
      xlim(0, 10)# create graph
  p + geom_smooth(method = lm, se=FALSE) # add line
  </code></pre>
  
  <p>Here is the ouput:
  <img src="https://i.stack.imgur.com/ru7jM.png" alt="desired graphical output"></p>