title: R plot - spurious lines appear when exported in pdf format
body: <p>Following <a href="https://stackoverflow.com/questions/16774928/removing-part-of-a-graphic-in-r/16777379#16777379">a previous question</a> (this one is independent of the previous one, though), I ended up with the following nice (isn't it?!) picture (R code is shown below).</p>
  
  <p>However, when I export the picture in pdf format, the quality is kind of disappointing; spurious white lines appear in the top right corner :(</p>
  
  <p>Do you have a solution?</p>
  
  <p><img src="https://i.stack.imgur.com/b9qld.png" alt="enter image description here"></p>
  
  <hr>
  
  <pre><code>library(gplots)
  
  f &lt;- function(S1, S2, theta)
  {
    num &lt;- (S1^(-theta) + S2^(-theta) - 1)^(-1 / theta)
    denom &lt;- S1 * S2
    return(num / denom)
  }
  
  S1 &lt;- S2 &lt;- seq(0.05, 0.95, 0.01)
  z &lt;- outer(S1, S2, FUN=f, theta=2/3)
  levels=seq(1.1, 8, length.out=25)
  
  windows(5,5)
  par(mgp=c(2, 0.5, 0))
  plot(NA,
       xlim=rev(c(0, 1)), xlab=expression(S[1](t)), xaxt="n",
       ylim=rev(c(0, 1)), ylab="", yaxt="n",
       frame=FALSE)
  mtext(text=bquote(S[2](t)), side=2, line=1.8, las=1) 
  axis(1, c(1, 0), label=TRUE, tcl=-0.5)
  axis(1, seq(1, 0, -0.25), label=FALSE, tcl=-0.25)
  axis(2, c(1, 0), label=TRUE, tcl=-0.5)
  axis(2, seq(1, 0, -0.25), label=FALSE, tcl=-0.25)
  par(mgp=c(3, 1, 0))  
  
  .filled.contour(x=S1, y=S2, z=z,
                  levels=levels,
                  col=colorpanel(length(levels), "gray95", "gray20", "black"))
  </code></pre>