title: Why is geom_raster being smoothed out in a knitr doc?
body: <p>I am plotting a matrix with geom_raster in ggplot.  If I look at the plot myself in RStudio, it is unsmoothed:</p>
  
  <p><a href="https://i.stack.imgur.com/AT9dG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AT9dG.png" alt="enter image description here"></a></p>
  
  <p>When I compile the knitr doc into a PDF, it gets smoothed somehow:</p>
  
  <p><a href="https://i.stack.imgur.com/ot4og.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ot4og.png" alt="enter image description here"></a></p>
  
  <p>Any idea what's happening?</p>
  
  <p>(Ignore the aspect ratio, I'd expect that.)</p>
  
  <p>The R code is basically this (variable names changed):</p>
  
  <pre><code>ggplot(subset(data, x != y), aes(x, y)) +
    geom_raster(aes(fill=the_fill), interpolate=FALSE) +
    facet_wrap(~a_facet)
  </code></pre>