Several functions in the R base graphics system, including rect() and polygon() , support cross-hatching through their angle= and density= arguments:
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)

How can I apply a similar cross-hatching to the polygon drawn by grid.polygon() :
library(grid) grid.newpage() grid.polygon(x,y)

I looked at the documentation for ?grid.polygon and ?gpar , and looked at Paul Murrellβs book on the R chart, and so far has come to nothing. Am I missing something? If not, is there a simple hack that will make this possible?
r graphics r-grid
Josh O'Brien Sep 29 '14 at 22:51 2014-09-29 22:51
source share