polygon(x, y, density=-1, angle=45, border=T, col=par("col"))
Graphical parameters may also be supplied as arguments to this function (see par).
The Windows devices (win.graph, win.printer) in S-PLUS for Windows will look for a "MaxVertices" entry in the [Workarounds] section of the SPLUS.INI file for the limit to use. This limit has a max of about 16,000, but many devices have much lower limits. That entry may require some tuning for your particular printer device.
# read graphic input, draw and shade polygon polygon(locator(type="l"))# shade the area between lines x1,y1 and x2,y2 polygon( c(x1,rev(x2)), c(y1,rev(y2)) )
# two polygons px1,py1 and px2,py2 separated by NAs polygon( c(px1,NA,px2), c(py1,NA,py2), col=3:4)
# an abstract art show dev.ask() for (i in 1:20) { plot(type="n",xlim=c(0,20),ylim=c(0,20),1:4,axes=F,ylab="",xlab="") polygon(sample(20,40,replace=T),sample(20,40,replace=T))}