title: Poor resolution in knitr using Rmd
body: <p>I have a .Rmd file and I am trying to create a .docx file via the function pandoc. </p>
  
  <p>I want to have a figure with final resolution of 504x504 pixels (i.e., 7x7inch with 72dpi). Unfortunately, the default 72 dpi is too poor in quality, and I would like to increase it to, say, 150 dpi without altering the final resolution (so it will already have the correct size within the .docx file). If I keep options fig.width and fig.height=7 and set dpi=150, I get the quality I want but the final resolution increases and the figure blows outside the .docx margins. I tried playing with the arguments out.width and out.height but when I include those it just doesn't plot anything in the final .docx. </p>
  
  <p>Ideas?</p>
  
  <h1>Example .Rmd code:</h1>
  
  <pre><code>My title
  -------------------------
  
  *(this report was produced on: `r as.character(Sys.Date())`)*  
  
  That's my plot
  
  ```{r echo=FALSE}
      plot(0,0,type="n",xlim=c(0,500), ylim=c(-12,0), las=1)
      color  &lt;-  rainbow(500)
      text(380,-1,"Test",pos=4)
      lseq   &lt;-  seq(-6,-2,length.out=500)
      for(j in seq_along(lseq)) {
          lines(c(400,450), rep(lseq[j], 2), col=color[j])
      }
      polygon(c(400,450,450,400), c(-6,-6,-2,-2), lwd=1.2)
  ```
  </code></pre>
  
  <h1>Transforming into .docx</h1>
  
  <pre><code>library(knitr)
  library(markdown)
  knit("example.Rmd")  # produces the md file
  pandoc("example.md", format = "docx") #prodces the .docx file
  </code></pre>
  
  <p>If I try to rescale the figure, it just does not work. Below:</p>
  
  <pre><code>My title
  -------------------------
  
  *(this report was produced on: `r as.character(Sys.Date())`)*  
  
  That's my plot
  
  ```{r echo=FALSE, dpi=150, fig.width=7, fig.height=7, out.width=504, out.height=504}
      plot(0,0,type="n",xlim=c(0,500), ylim=c(-12,0), las=1)
      color  &lt;-  rainbow(500)
      text(380,-1,"Test",pos=4)
      lseq   &lt;-  seq(-6,-2,length.out=500)
      for(j in seq_along(lseq)) {
          lines(c(400,450), rep(lseq[j], 2), col=color[j])
      }
      polygon(c(400,450,450,400), c(-6,-6,-2,-2), lwd=1.2)
  ```
  </code></pre>