title: How to apply cross-hatching to a polygon using the grid graphical system?
body: <p>Several functions in R's base graphical system, including <code>rect()</code> and <code>polygon()</code>, support cross-hatching via their <code>angle=</code> and <code>density=</code> arguments:</p>
  
  <pre><code>x = c(0, 0.5, 1, 0.5)
  y = c(0.5, 1, 0.5, 0)
  par(mar=c(0,0,0,0))
  plot.new()
  polygon(x, y, angle=45, density=10)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Y2GXg.png" alt="enter image description here"></p>
  
  <p>How might I apply similar cross-hatching to a polygon drawn by the <strong>grid</strong> graphical system's <code>grid.polygon()</code> function:</p>
  
  <pre><code>library(grid)
  grid.newpage()
  grid.polygon(x,y)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/MGtfK.png" alt="enter image description here"></p>
  
  <p>I've looked in the documentation for <code>?grid.polygon</code> and <code>?gpar</code>, and have skimmed through Paul Murrel's book on R graphics, and have so far come up empty. Am I missing something obvious? If not, is there some simple hack which will make this possible?</p>