I don't think this is possible.   With an opaque background you can get back 
the background color just by overwriting, but any additional painting can only 
increase the opacity so you can't get back to transparent.

   -thomas

On Thu, 8 Apr 2010, Terry Therneau wrote:

I have a case where the easiest way to draw a particular symbol would be
to draw something a little bigger, and then use polygon(... , col=0) to
erase the extra stuff.  Just how to do this best when par('bg') =
'transparent' is, however, eluding me.  I've looked through the archives
and the book R Graphics without quite seeing the light.
 Help or pointers to help would be welcome.

Terry T

Details (for the inquiring mind).  In drawing a pedigree  subjects are
depicted as cirle, square, diamond, or triangle (for gender= male,
female, unknown, terminated).  This can be subdivided into shaded
regions to show the value of various ancillary variables.  One ancillary
is easy - just fill with a color.  For two you fill the left and right
half separately, etc.  Two, three, four, ... variables become special
cases for each symbol.  An easy solution is to draw a larger circle with
the requisite number of shaded slices, then erase away what we don't
want.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Thomas Lumley                   Assoc. Professor, Biostatistics
tlum...@u.washington.edu        University of Washington, Seattle

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to