Skip to content
Back to formatted view

Raw Message

Message-ID: <5064484F.8020701@mayo.edu>
Date: 2012-09-27T12:36:31Z
From: Terry Therneau
Subject: erasing a polygon

I'm updating some (very) old code, and one particular option of its plot method depends on 
a once-was-true trick
     polygon(x, y, border=TRUE, col=0)
     polygon(x, y, border=TRUE, density=0)

would draw the polygon AND erase whatever was underneath it back to background color.

Is there a reliable way to do this with the current R (standard graphics)?

Terry Therneau

PS For the inquiring, the routine is text.rpart with the fancy=T option, and the original 
target was the postscript driver on Splus 3.4.  (I said it was old.)  The plot.rpart 
routine draws the branches, and text.rpart then wants to lay down some ellipses, erasing 
what is underneath them.